ABC372A-D
A - delete .在输出时过滤一遍即可
123456789101112131415161718#include <bits/stdc++.h>#define endl '\n'using ll = long long;using namespace std;const ll N = 2e5 + 5;int main() { string s; cin >> s; string ans; for (int i = 0; i < s.size(); i++) { if (s[i] != '.') { ans += s[i]; } } cout << ans << endl; return 0;}
B - 3^A打表后排序输出一遍即可
123456789101112131415161718192021222324252627282930313233343536373839#include <bits/stdc++.h& ...
CF974(DIV3) A-D
A. Robin Helps顺着题意做一遍模拟即可,代码如下:
123456789101112131415161718192021222324252627282930#include <bits/stdc++.h>#define endl '\n'using ll = long long;using namespace std;int main() { int t; cin >> t; while (t--) { int n, k; cin >> n >> k; ll temp = 0; ll ans = 0; vector<ll> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; if (a[i] >= k) { temp += a[i]; } if (a[i] == 0) { if (temp > 0) { a ...
CF972A-C
A. Simple Palindrome此题考虑把一样的字母放在一起,尽可能分成5份,代码如下:
12345678910111213141516171819202122232425262728293031#include <bits/stdc++.h>using ll = long long;using namespace std;#define endl '\n'const ll N = 1e6 + 5; int a[5];int main() { string s = "aeiou"; int t; cin >> t; while (t--) { int x; cin >> x; int temp = x / 5; int temp1 = x % 5; string ans; for (int i = 0; i < 5; i++) { a[i] = temp; } for (int i = 0; temp1 > 0; temp1--, ...
ABC371C-D
C - Make Isomorphic 此题思路为,利用全排列枚举所有点的关系,如果需要调整则调整,不需要就继续,代码如下: 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 #include <bits/stdc++.h>using ll = long long;using namespace std;const ll N = 1e6 + 5;ll n, mg, mh;bool g[10][10], h[10][10];int res[10];int a[10][10];ll ans = 1e18;int used[10];void dfs(int step) { if (step > n) { ll cost = 0; for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j ...
ABC366
A - Election 2题目大意: n张票,目前投了t给高桥,a给青木。 问剩余票随便分配,是否都是一个结局。解决思路:考虑最好的情况即可,代码如下:
1234567891011121314151617#include <bits/stdc++.h>using namespace std;using ll = long long;const int N = 1e6 + 5;int main() { int n, t, a; cin >> n >> t >> a; int temp = t + a; if (abs(t - a) + temp <= n) { cout << "No" << endl; } else { cout << "Yes" << endl; } return 0;}
B - Verti ...
test
这是一个测试文章,测试代码如下: 1234567891011#include <bits.stdc++.h>using namespace std;int main() { int n; cin >> n; cout << n; return 0;} 欢迎大家评论!!!