上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 28 下一页
摘要: A. Minimum Integer 题意:找最小的小于\(l\)或者大于\(r\)的\(d\)的倍数。 点击查看代码 void solve() { int l, r, d; std::cin >> l >> r >> d; if (l > d) { std::cout << d << "\n"; 阅读全文
posted @ 2025-04-14 16:18 maburb 阅读(21) 评论(0) 推荐(0)
摘要: A. Trippi Troppi 题意:给你三个字符串,将他们的首字母一起输出。 点击查看代码 void solve() { std::string a, b, c; std::cin >> a >> b >> c; std::cout << a[0] << b[0] << c[0] << "\n" 阅读全文
posted @ 2025-04-14 01:53 maburb 阅读(317) 评论(0) 推荐(2)
摘要: A - Status Code 点击查看代码 void solve() { int n; std::cin >> n; if (n >= 200 && n < 300) { std::cout << "Success\n"; } else { std::cout << "Failure\n"; } 阅读全文
posted @ 2025-04-12 21:58 maburb 阅读(194) 评论(0) 推荐(0)
摘要: A. Find Divisible 点击查看代码 void solve() { int l, r; std::cin >> l >> r; std::cout << l << " " << l * 2 << "\n"; } B. Substring Removal 题意:给你一个字符串,删去恰好一个 阅读全文
posted @ 2025-04-11 16:38 maburb 阅读(17) 评论(0) 推荐(0)
摘要: A. Dice Rolling 点击查看代码 void solve() { int x; std::cin >> x; if (x & 1) { std::cout << 1 + (x - 3) / 2 << "\n"; } else { std::cout << x / 2 << "\n"; } 阅读全文
posted @ 2025-04-10 16:31 maburb 阅读(24) 评论(0) 推荐(0)
摘要: A. Vasya and Book 点击查看代码 void solve() { int n, x, y, d; std::cin >> n >> x >> y >> d; if (std::abs(x - y) % d) { int ans = 1e9; if ((y - 1) % d == 0) 阅读全文
posted @ 2025-04-09 12:19 maburb 阅读(14) 评论(0) 推荐(0)
摘要: A. Ideal Generator 题意:给你\(k\),求能不能使得所有的\(n \leq k\)的\(n\),都能构造一个全部非零的长度为\(k\)的总和为\(n\)的回文数组。 如果\(k\)是奇数,都放\(1\)然后剩下的给中间就行了。 如果是偶数,无解。 点击查看代码 void solv 阅读全文
posted @ 2025-04-09 01:23 maburb 阅读(607) 评论(6) 推荐(4)
摘要: A. Minimizing the String 题意:删除一个字符使得字符串字典序最小。 经典结论,删第一个\(s_i > s_{i+1}\)。 点击查看代码 void solve() { int n; std::cin >> n; std::string s; std::cin >> s; fo 阅读全文
posted @ 2025-04-08 05:17 maburb 阅读(17) 评论(0) 推荐(0)
摘要: A. Diverse Substring 看能不能选两个不一样的字符。 点击查看代码 void solve() { int n; std::cin >> n; std::string s; std::cin >> s; if (std::ranges::count(s, s[0]) == n) { 阅读全文
posted @ 2025-04-07 17:25 maburb 阅读(21) 评论(0) 推荐(0)
摘要: A. 吔我大炮! 点击查看代码 void solve() { int a, b, c; std::cin >> a >> b >> c; if (a * b <= c) { std::cout << "YES\n"; } else { std::cout << "NO\n"; } } B. 梦间 题 阅读全文
posted @ 2025-04-06 21:05 maburb 阅读(102) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 28 下一页