摘要: P4552 [Poetize6] IncDec Sequence 这题其实很有意思,当diff[2, n]都为0时,数组全等于a[1] 点击查看代码 #include<bits/stdc++.h> using namespace std; using ll = long long; int main 阅读全文
posted @ 2025-05-19 16:38 Chuan81 阅读(9) 评论(0) 推荐(0)
摘要: P2882 [USACO07MAR] Face The Right Way G 好难啊~ 点击查看代码 #include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a(n + 1), f 阅读全文
posted @ 2025-05-19 16:25 Chuan81 阅读(14) 评论(0) 推荐(0)
摘要: P1163 银行贷款 浮点二分 点击查看代码 #include<bits/stdc++.h> using namespace std; using ll = long long; int main() { double n, m, k; cin >> n >> m >> k; double left 阅读全文
posted @ 2025-05-19 12:56 Chuan81 阅读(22) 评论(0) 推荐(0)
摘要: P1182 数列分段 Section II 不知道long long不开有没有影响,left的值必须是最大的\(A_i\) 点击查看代码 #include<bits/stdc++.h> using namespace std; const int N = 100010; int n, m; vect 阅读全文
posted @ 2025-05-19 12:47 Chuan81 阅读(9) 评论(0) 推荐(0)
摘要: P3853 [TJOI2007] 路标设置 这题目真恶心,第一眼看过去以为0和L会给在数组里面 点击查看代码 #include <bits/stdc++.h> using namespace std; const int N = 100010; int l, n, k; vector<int> p; 阅读全文
posted @ 2025-05-19 11:25 Chuan81 阅读(7) 评论(0) 推荐(0)
摘要: P2678 [NOIP 2015 提高组] 跳石头 调半天ans更新位置错了。 点击查看代码 #include<bits/stdc++.h> using namespace std; const int N = 50010; int l, n, m; vector<int>s(N); bool ch 阅读全文
posted @ 2025-05-19 10:22 Chuan81 阅读(10) 评论(0) 推荐(0)
摘要: P2440 木材加工 真不是我想水题目,只是单纯我真的很水 点击查看代码 #include<bits/stdc++.h> using namespace std; const int N = 100010; vector<int>l(N); int n, k; bool check(int x) { 阅读全文
posted @ 2025-05-19 09:23 Chuan81 阅读(50) 评论(0) 推荐(0)
摘要: P1100 高低位交换 单片机玩多了就会秒了owo 点击查看代码 #include<bits/stdc++.h> using namespace std; using ll = long long; using uint = unsigned int; int main() { uint a; ci 阅读全文
posted @ 2025-05-19 03:46 Chuan81 阅读(11) 评论(0) 推荐(0)
摘要: P1469 找筷子 亏我是电子信息大类的,异或想半天没想到 点击查看代码 #include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); int n 阅读全文
posted @ 2025-05-19 03:41 Chuan81 阅读(8) 评论(0) 推荐(0)
摘要: P1143 进制转换 水一下 点击查看代码 #include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; string s; cin >> s; int m; cin >> m; reverse(s.begin( 阅读全文
posted @ 2025-05-19 02:47 Chuan81 阅读(8) 评论(0) 推荐(0)
摘要: P1331 海战 学太多东西反而容易想得太多做不出来 检测是否合法只需先搜索出以当前位置向右向下连续'#'的长度和深度, 在以这两个参数为长宽的矩阵中搜索是否存在'.', 存在就不合法,不存在就看一下这个矩阵周边半径一格位置是否有'#'(即其他船) 有其他船就不合法,否则就将这艘合法船所占空间全部标 阅读全文
posted @ 2025-05-19 02:31 Chuan81 阅读(11) 评论(0) 推荐(0)