03 2022 档案
摘要:原题链接 样例输入 2 7 3 4 2 2 1 1 1 2 4 3 1 1 1 2 样例输出 5 1 思路 一定存在一个最高的高楼,这个高度一定是最后的高度,那么我们最先相出的做法就是,找到这个高楼的位置,然后在其两边一直加知道所有的楼都相同,但是这么写特别麻烦,甚至不可写。 对于这种区间操作的问题
阅读全文
摘要:转自 { // Place your oj_env workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and // description. Add
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> #include <windows.h> typedef int DataType; typedef struct Node { DataType data; struct Node* next; } Node, *Lis
阅读全文
摘要:传送门 题意 有一个 面的骰子,每次投掷每个面都是等概率出现,求所有面都出现的期望投掷次数。 思路 我们进行一个状态定义: 表示已经出现了 个不同的面的期望,那么我们考虑 可以由谁转移过来? 显然我们每次投掷最多只会出现一个面,这个面有两种情
阅读全文
摘要:n = int(input()) a = [list(map(int, input().split())) for _ in range(n)] # 二维数组.jpg ans = 0 for x1, y1 in a : for x2, y2 in a: for x3, y3 in a: if x1
阅读全文
摘要:D. Potion Brewing Class /******************** Author: Nanfeng1997 Contest: Codeforces - Codeforces Round #778 (Div. 1 + Div. 2, based on Technocup 202
阅读全文
摘要:运筹学 引论 什么是运筹学? 目的:寻找问题的最优解(一般) 来源:军事 我们干什么:应用视角 核心思想: 求某个问题的最优解 高数基础 函数的最值与极值 最值考虑整体性,极值考虑局部性 极值:设在$x
阅读全文
摘要:为什么我只能做出两题啊 /fn /fn /fn !!!
阅读全文
摘要:a = list(map(int, input().split())) #python 读入一行 a.sort() print(a[0] ,a[1] ,a[6] - a[0] - a[1])
阅读全文
摘要:我们都有光明的未来~
阅读全文
摘要:## 算法模板(乱序) ### 树状数组 ```cpp template class fenwick { public: vector fenw; int n; fenwick(int _n) : n(_n) { fenw.resize(n); } void modify(int x, T v) {
阅读全文
摘要:传送门 题目描述 给出一个区间, 求这个区间内有多少个数字满足如下条件: 每相邻两个数位和为素数 其中至少一个数位为 没有前导 数据范围 思路 典型的 数位DP 计算方式为 \(f(r) - f(l-1
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; using LL = long long; void solve(); int main() { // ios::sync_with_stdio(false); // cin.tie(nullptr); in
阅读全文
摘要:工作安排 题目地址: 2022/3/13 题目描述 约翰有太多的工作要做。 为了让农场高效运转,他必须靠他的工作赚钱,每项工作花一个单位时间。 他的工作日从 时刻开始,有 个单位时间。 在任一时刻,他都可以选择编号 到 的 项工作中的
阅读全文
摘要:图形学 --(中点画线法 + Bresenham 画线算法)
阅读全文
摘要:莫队模板题 CODE #include <bits/stdc++.h> using namespace std; using LL = long long; const int N = 5e4 + 10, M = 510; int n, m, k, block; int lal = 1, lar =
阅读全文
摘要:题目链接:D. Multiple Subject Lessons 题意 给定 和 ,表示 个学生,每个学生有 种颜色的笔,每个学生需要在纸上写下若干个数字,使得数字和为 。问共有多少不同种方案。 SOLUTION 表示
阅读全文
摘要:Good Website: - [Latex公式大全](https://www.luogu.com.cn/blog/IowaBattleship/latex-gong-shi-tai-quan) - [长得像素数的合数](https://www.zhihu.com/question/54189487
阅读全文
摘要:题目链接 F.Group Projects 题意 把 个物品分成若干组,每个组的代价为组内价值的极差,求所有组的代价之和不超过 的方案数。 考虑 DP, 表示考虑到第 个物品的时候,还有 组尚未分配完毕,当前状态总代价为
阅读全文
摘要:点击查看代码 #include <cstdio> int main() { printf("Hello World"); return 0; }
阅读全文