11 2021 档案
摘要:### 第一章 动态规划 #### 数字三角形模型1 [$AcWing$ $1015$. 摘花生](https://www.cnblogs.com/littlehb/p/15608068.html) [$AcWing$ $1018$. 最低通行费](https://www.cnblogs.com/l
阅读全文
摘要:##[$AcWing$ $1018$. 最低通行费](https://www.acwing.com/problem/content/1020/) ### 一、题目描述 一个商人穿过一个 $N×N$ 的正方形的网格,去参加一个非常重要的商务活动。 他要从网格的 **左上角** 进,**右下角** 出。
阅读全文
摘要:\(AcWing\) \(1015\). 摘花生 一、题目描述 \(Hello\) \(Kitty\)想摘点花生送给她喜欢的米老鼠 她来到一片有网格状道路的矩形花生地(如下图),从 西北角 进去,东南角 出来 地里每个道路的交叉点上都有种着一株花生苗,上面有若干颗花生,经过一株花生苗就能摘走该它上面
阅读全文
摘要:题目传送门 //P3383.cpp #include <bits/stdc++.h> using namespace std; const int N = 1e8 + 10; //欧拉筛 int primes[N], cnt; // primes[]存储所有素数 bool st[N]; // st[
阅读全文
摘要:mstsc www.wmarkj.com:27008 #https://dsideal.obs.cn-north-1.myhuaweicloud.com/HuangHai/ip.txt #远程端口:27001
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; const int N = 110; struct Node { int weight; //重量 int volume; //体积 int money; //让利金额 } a[N]; /** 测试用例 10
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const int N = 1010; int n, m; int v[N], w[N]; int f[N]; /** 测试用例: 80 2 18 10 30 20 */ //完全背包问题 int main(
阅读全文
摘要:题目: #include<bits/stdc++.h> using namespace std; const int N = 1010; int n, m; int v[N], w[N]; int f[N]; int main() { //优化输入 ios::sync_with_stdio(fals
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; //2^7是极大值,就是 128是队伍的最大值,完全二叉树的最底层是128,上面肯定是127个,加在一起是255个,声明一个大于255的数字N可以保存的下 const int N = 260; i
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; stack<char> s; int num; /** 测试用例: 2 [({})] ()[]() */ char trans(char a) { if (a == ')') return '('; if (
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; typedef long long LL; int n, q, cmd, i, j, k; int main() { cin >> n >> q; vector<vector<int> > loc
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; int n, m, tmp; vector<int> stu; int main() { cin >> n >> m; for (int i = 1; i <= n; i++) { cin >>
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; typedef long long LL; const int M = 1e6 + 10; int m, n, k;//m表示学校数,n表示学生 int a[M]; long long res;
阅读全文
摘要:题目传送门 一、朴素解法 #include <bits/stdc++.h> using namespace std; const int N = 10010; typedef long long LL; struct Person { int first, second; } p[N]; int n
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; typedef long long LL; const int N = 5010; int n, s; //苹果数 n,力气 s int a, b; //椅子的高度a,陶陶手伸直的最大长度b。 s
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 25; typedef long long LL; LL f[N][N][N]; LL w(LL a, LL b, LL c) { //注意判断的顺序,防止数组下标越界
阅读全文
摘要:题目传送门 一、深度优先搜索 #include <bits/stdc++.h> using namespace std; int n; //毫不意外,只通过了5个测试点,TLE了15个点~ int dfs(int x) { //1就没法继续分了,同时,由于题目说:原数列不做任何修改就直接统计为一种合
阅读全文
摘要:题目传送门 一、递推+高精度 #include <bits/stdc++.h> using namespace std; const int N = 5010; /** * 功能:高精度加法模板 * @param A * @param B * @return */ vector<int> add(v
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; double k; double x; int main() { cin >> k; for (int cnt = 1;; cnt++) { x += 2.0 * pow(0.98, cnt -
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; typedef long long LL; const LL MOD = 1e9 + 7;//要模的质数 const int N = 1e5 + 10; int a[N]; //木棍长度数组,木棍
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 10; //数字0-9需要的火柴个数,这个字典妙啊~,成为解决火柴棍难题的关键~ int a[N] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 110; char a[N][N]; //以i,j为坐标的点,向右找k个,看看是不是都是空地;向下找k个,看看是不是都是空地 int check(int i, int
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 110; char a[N][N]; int MIN = 0x3f3f3f3f; int n, m; /** * 功能:计算在白x行,蓝y行,红z行的情况下,修改的数量
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; int a[10]; int main() { int n; cin >> n; //放入数组 for (int i = 1; i <= n; i++) a[i] = i; do { //输出打印
阅读全文
摘要:题目传送门 一、暴力大模拟 #include <bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; bool found = false; for (int i1 = 1; i1 <= 9
阅读全文
摘要:题目传送门 一、无脑大循环 #include<bits/stdc++.h> using namespace std; vector<string> v1; int main() { int a, b, c, d, e, f, g, h, i, j, k, l = 0; cin >> k; for (
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 30; string a[N]; bool cmp(const string &a, const string &b) { //自定义排序函数,这一步非常巧妙,假设a=
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 110; struct Student { string Name; int year, month, day, num; } a[N]; bool cmp(const
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 50010; struct Point { int x, y, z; } a[N]; bool cmp(const Point &a, const Point &b)
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 5010; struct Person { int k; int s; } a[N]; bool cmp(const Person &a, const Person &
阅读全文
摘要:题目传送门 一、原始方法 #include<bits/stdc++.h> using namespace std; const int N = 1010; int a[N], c[N]; int main() { int n; scanf("%d", &n); for (int i = 1; i <
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 10010; int a[N]; int n, cnt; int main() { cin >> n; for (int i = 1; i <= n; i++) cin
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 20010; int a[N]; int main() { int n, b; cin >> n >> b;//b是书架的高度 for (int i = 1; i <=
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; int n; const int N = 30; struct Node { string x; int num; } a[N]; bool cmp(const Node &A, const No
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 310; int n; struct Student { int id, chinese, total; } a[N]; bool cmp(const Student
阅读全文
摘要:题目传送门 #include<bits/stdc++.h> using namespace std; const int N = 110; int a[N]; int main() { int n; cin >> n; for (int i = 0; i < n; i++) cin >> a[i];
阅读全文
摘要:题目传送门 #include<bits/stdc++.h> using namespace std; const int N = 5000010; int a[N]; void quick_sort(int q[], int l, int r, int k) { if (l >= r)return;
阅读全文
摘要:题目传送门 #include<bits/stdc++.h> using namespace std; const int N = 100010; int a[N]; void quick_sort(int q[], int l, int r) { if (l >= r) return; int i
阅读全文
摘要:题目传送门 //P1271.cpp #include <bits/stdc++.h> using namespace std; const int N = 1010; int a[N]; int n, m, tmp; int main() { cin >> n >> m; for (int i =
阅读全文
摘要:P1045 [NOIP2003 普及组] 麦森数 题目传送门 一、前导知识 高精度乘法 老师将高精乘高精,高精乘低精想办法合并成了一个模板 没错应该看的出来,高精度乘法其实就是一位一位去乘,然后按位存储在数组里面,思路差不多就是这样。 由于位数比较多,我们用字符串来进行输入,处理后按位存到整型数组中
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; typedef long long LL; const int N = 1e5 + 10; int n, num; int ans; vector<int> c; int a[N], al; in
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 1e6 + 10; int a[N]; void mul(int a[], int b, int &len) { int t = 0; for (int i = 1;
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; /* 1.所有信息输入后排序,排序方式如下: (1)先按帮贡排序; (2)如帮贡一样,则按输入顺序排列。 2.再重新编好职位后排输出顺序,也就是职位内的排名,排序方式如下: (1)先按现在的职位排
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 20 + 10; //m<20,n<20,范围是20以内,开大一点防止出错 //本题,不吸氧,可以过10个点,第11个点TLE。吸氧后可以能完全部11个点。 //用来记
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; //批量输出某个字符 void print(char c, int cnt) { for (int i = 1; i <= cnt; i++) cout << c; } int main() {
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 110; int main() { int n; cin >> n; int x; // a[0~n-1]是系数,a[n]是常数 for (int i = 0; i <
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 10; char g[N][N]; //北,东,南,西 int dx[] = {-1, 0, 1, 0}; int dy[] = {0, 1, 0, -1}; int
阅读全文
摘要:题目传送门 一、以下标0开始 #include <bits/stdc++.h> using namespace std; const int N = 210; //0 表示“剪刀”,1 表示“石头”,2 表示“布”,3 表示“蜥蜴人”,4表示“斯波克”。 //看图打表写出对阵双方的胜负平结果二维数组
阅读全文
摘要:题目传送门 //P1009.cpp #include <bits/stdc++.h> using namespace std; //本题有坑,使用长整也过不了洛谷的用例,因为它的用例是22,需要高精度,也就是乘法高精度+加法高精度 typedef long long LL; int n; LL re
阅读全文
摘要:题目传送门 //P1303.cpp #include <bits/stdc++.h> using namespace std; /** * 功能:高精度乘低精度模板 * @param A * @param b * @return */ vector<int> mul(vector<int> &A,
阅读全文
摘要:题目传送门 //P1601.cpp #include <bits/stdc++.h> using namespace std; /** * 功能:高精度加法模板 * @param A * @param B * @return */ vector<int> add(vector<int> &A, ve
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; int n, m; const int N = 1e5 + 10; struct Node { int dir; //方向,0:圈内,1:圈外 string name;//姓名 } c[N]; i
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 110; char a[N][N]; int dx[] = {0, 0, -1, 1, -1, 1, -1, 1}; //上下左右,左上,右上,左下,右下 int dy
阅读全文
摘要:题目传送门 //P1042.cpp #include <bits/stdc++.h> using namespace std; //每行至多 25 个字母,最多有 2500 行。 const int N = 25 * 2500 + 10; int a[N];//小华的输赢状态表 int idx; i
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 1e6; struct Student { string name; int age, score; } a[N]; int main() { int n; cin >
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; typedef long long LL; int n; /** 思路分析: 1、比如第10天桃子数量为1,我们记为s10=1. 2、那么我们可以考虑s9是多少? 3、第9天时,吃掉了s9的一半,
阅读全文
摘要:题目传送门 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 110; LL a[N]; int n; LL res; int main() { //录入进来,终止条件是CTRL+D wh
阅读全文
摘要:题目传送门 一、原始暴力法 #include<bits/stdc++.h> using namespace std; const int N = 100000010; //判断一个数是不是质数 bool isPrime(int n) { if (n < 2) return false; for (i
阅读全文
摘要:题目传送门 一、暴力解法 #include <bits/stdc++.h> using namespace std; bool isPrime(int n) { for (int i = 2; i <= n / i; i++) if (n % i == 0) return false; return
阅读全文
摘要:题目传送门 一、原始解法 #include <bits/stdc++.h> using namespace std; //判断一个数是不是质数 bool isPrime(int n) { if (n < 2) return false; for (int i = 2; i <= n / i; i++
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 1010; struct node { int id;//学号 double sc1, sc2;//学业成绩和素质拓展成绩 int score;//学业成绩和素质拓展成
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 1100; struct Student { string name; int x; int y; int z; int sum; } a[N]; int n; voi
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; struct Student { string Name; int chinese; int math; int english; } a, ans; int main() { int n; ci
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 1100; int a[N][N]; /**递归经典题 1、默认二维数组全是0,可以理解为默认都被赦免,如果找到不被赦免的,需要标识为1. 2、看到2^n之类的题,一般
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; int f(int n) { if (n == 1) return 1; return n * f(n - 1); } int main() { int n; cin >> n; cout <<
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 110; int n, m; int a[N]; double Max = -1; int main() { cin >> n >> m; for (int i = 1
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; //是不是闰年 bool isRunYear(int y) { if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0) return true; ret
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 110; int a[N]; bool isPrime(int n) { if (n < 2) return false; for (int i = 2; i <= n
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; double dis(double x1, double y1, double x2, double y2) { return sqrt((x2 - x1) * (x2 - x1) + (y2 -
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; int n = 4; string s; unordered_map<char, int> _map; int main() { //读入并记录 while (n--) { getline(cin
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; int a[3]; char s1, s2; int main() { //充分利用c++语言优势 while (scanf("%c:=%c;", &s1, &s2) == 2) //赋值语句简洁
阅读全文
摘要:题目传送门 #include<bits/stdc++.h> using namespace std; string a; string b; int main() { cin >> a >> b; int sum1 = 1; for (int i = 0; i < a.size(); i++) su
阅读全文
摘要:题目传送门 #include<bits/stdc++.h> using namespace std; //原始英文数字 // You are a three eight pig . 10964 unordered_map<string, int> _map = {{"zero", 0}, {"one
阅读全文
摘要:题目传送门 #include<bits/stdc++.h> using namespace std; /** 0.000009->0.9 0.900000->0.000009 00000.00000->0.0 0/1230000->0/321不是0也不是0/0000321 000000000->0
阅读全文
摘要:题目传送门 #include<bits/stdc++.h> using namespace std; int boy, girl;//存放答案滴 string x; //这道题太无聊了~ int main() { cin >> x; for (int i = 0; i < x.length(); i
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; int maxN; /** * 功能:获取字符串中有多少个VK */ int getVkCount(string s) { int cnt = 0; for (int i = 0; i < s.l
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 26; //常数字典 int a[N] = {1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 4, 1, 2
阅读全文
摘要:题目传送门 一、知识点整理 1、字符串转小写 //转为小写 transform(a.begin(), a.end(), a.begin(), ::tolower); for (int i = 0; i < b.size(); i++) if (b[i] >= 'A' && b[i] <= 'Z')
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; string s, a; int n; int opt; int l, cnt; int main() { cin >> n >> s; while (n--) { cin >> opt; swi
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; string s; int c; int main() { while (cin >> s) c += s.size(); printf("%d", c); return 0; }
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; char c;//操作符 int n, a, b; char s[100]; int main() { cin >> n; while (n--) { //学习scanf和sprintf两个函数的
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 30; const int INF = 0x3f3f3f3f; int Max, Min = INF; int b[N]; //计数数组 bool IsPrime(in
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; int n; string s; int main() { cin >> n >> s; for (int i = 0; i < s.size(); i++) { int c = s[i] + n
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; int main() { string s; cin >> s; //方式1 for (int i = 0; i < s.size(); i++) printf("%c", toupper(s[i
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const int N = 25; int a[N][N][N]; int main() { int w, x, h, q; cin >> w >> x >> h >> q; int x1, y1, z1,
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const int N = 1010; int a[N][5];//二维的最后一个位置,装总分 int n; int cnt; int main() { cin >> n; for (int i = 1; i
阅读全文
摘要:重点: 用数组记数,大于$0$的就表示被移走了,等于$0$的没动过。 #include <bits/stdc++.h> using namespace std; const int N = 10010; int b[N]; int l; int m; //区域的数目 int u, v; //表示一个
阅读全文
摘要:#include <bits/stdc++.h> using namespace std; const int N = 210; int a[N], cnt; int n; int main() { cin >> n; while (n > 1) { a[cnt++] = n; if (n % 2
阅读全文
摘要:题目传送门 #include <bits/stdc++.h> using namespace std; const int N = 110; int a[N]; int main() { int idx; //数字0时终止输入 for (idx = 0;; idx++) { cin >> a[idx
阅读全文
摘要:题目传送门 重点: 使用数组为每条小鱼记数。 #include <bits/stdc++.h> using namespace std; const int N = 110; int a[N], b[N], n; int main() { cin >> n; //每一条小鱼的可爱值 for (int
阅读全文
摘要:第一部分 语言入门 第一章 简简单单写程序 例 1-11 评测机队列 第二章 顺序结构程序设计 例题 P5703 红 例5 P5704 红 例6 P5705 红 例71 P5706 红 例8 P1425 红 例10 P3954 红 例11(NOIP 2017 PJ T1) P5707 橙 例12 习
阅读全文

浙公网安备 33010602011771号