随笔分类 - acm
摘要:A #include <bits/stdc++.h> using namespace std; int main() { string s; int a, b; cin >> s >> a >> b; swap(s[a - 1], s[b - 1]); cout << s << endl; retu
阅读全文
摘要:A #include <bits/stdc++.h> using namespace std; int n, k; struct node { int a, b; }p[110]; bool cmp(node x, node y) { if (x.a == y.a) return x.b > y.b
阅读全文
摘要:A class Solution { public: int minimumCost(vector<int>& cost) { sort(cost.begin(), cost.end()); vector<int> v; int sum = 0; for (int i = cost.size() -
阅读全文
摘要:A class Solution { public: int countElements(vector<int>& nums) { int minn = 0x3f3f3f3f, maxx = 0xcfcfcfcf; for (auto x : nums) minn = min(minn, x), m
阅读全文
摘要:A 双指针 #include <bits/stdc++.h> #define PII pair<int, int> using namespace std; const int N = 2e5 + 10; int T, n, d; int a[N]; int main() { scanf("%d",
阅读全文
摘要:A 签到题 #include <bits/stdc++.h> using namespace std; int T, n; int main() { cin >> T; while (T -- ) { cin >> n; int sum = 0; vector<string> v1, v2; str
阅读全文

浙公网安备 33010602011771号