上一页 1 2 3 4 5 6 7 ··· 12 下一页
摘要: A 读完题总是会楞一下,然后才开始写。 一遍 AC。 const int MAXN = 100 + 10; int n, p, q; char ss[MAXN]; int main() { scanf("%d %d %d", &n, &p, &q); scanf("%s", ss); for (in 阅读全文
posted @ 2021-10-19 15:59 Handwer 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 更新到:Educational Codeforces Round 10 题解 树上问题 与某一点的子树有关的,思考树形 dp,dsu on tree 如果是某个点与所有点有关,对所有点求答案,就考虑换根 dp。能换根的前提是 dp 方程可以轻松地修改(取 / 不取某一个子树)(1 2) 与某两个点有 阅读全文
posted @ 2021-10-18 09:40 Handwer 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 打得很烂,预计 1500 只拿到了 700,甚至比 VP 打得还要差。 A 一遍 AC。 int main() { int x = read(); if (x % 100 == 0 && x > 0) puts("Yes"); else puts("No"); return 0; } B 一遍 AC 阅读全文
posted @ 2021-10-18 08:00 Handwer 阅读(103) 评论(0) 推荐(0) 编辑
摘要: A 一遍 AC。 int main() { int a, b, c; cin >> a >> b >> c; for (int i = a; i <= b; ++i) { if (i % c == 0) { cout << i << endl; return 0; } } cout << -1 << 阅读全文
posted @ 2021-10-17 17:04 Handwer 阅读(29) 评论(0) 推荐(0) 编辑
摘要: A. USB Driver 脑抽了居然升序排序。。愣了几秒才发现 一遍 AC。 const int MAXN = 100 + 10; int n, aa[MAXN]; int main() { std::ios::sync_with_stdio(false); cin.tie(0); cout.ti 阅读全文
posted @ 2021-10-14 21:59 Handwer 阅读(26) 评论(0) 推荐(0) 编辑
摘要: A. Seismic magnitude scales 一遍 AC。 int a, b; int main() { std::ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> a >> b; if (a > b) std::sw 阅读全文
posted @ 2021-10-14 12:47 Handwer 阅读(34) 评论(0) 推荐(0) 编辑
摘要: A. Extract Numbers 有一说一这题挺毒的,乍一看是个垃圾模拟其实要处理的东西还蛮多,而且我还决定了要边读入边处理,再加上 Vim 用的还不熟练,写着写着就写急躁了。因此我总共写了 17 分钟,换了两种写法才过。 一遍 AC。 #错误警示:心态很重要,细节也要想清楚。Think twi 阅读全文
posted @ 2021-10-13 19:04 Handwer 阅读(20) 评论(0) 推荐(0) 编辑
摘要: A. Four Digits 一遍 AC。 int n; int main() { scanf("%d", &n); std::string str = std::to_string(n); while (str.size() != 4) str = '0' + str; printf("%s\n" 阅读全文
posted @ 2021-10-13 16:40 Handwer 阅读(70) 评论(0) 推荐(0) 编辑
摘要: A. 牛牛的方程式 数学题。 考虑 \(ax + by = c\) 有解的充要条件是 \(c|\mathrm{gcd}(a, b)\),于是 \(ax + by\) 可以表示的所有整数即为 \(\mathrm{gcd}(a,b)t\) 代入原式:\(\mathrm{gcd}(a,b)t + cz = 阅读全文
posted @ 2021-10-13 11:22 Handwer 阅读(34) 评论(0) 推荐(0) 编辑
摘要: A. Tricky Sum 居然没有一眼秒掉。。自闭了 1 到 n 的和很好算,小于等于 n 的所有 2 的幂次之和也很好算,把后面那个东西减两次就做完了。 一遍 AC。 int main() { std::ios::sync_with_stdio(false); cin.tie(0); cout. 阅读全文
posted @ 2021-10-12 18:30 Handwer 阅读(33) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 12 下一页