随笔分类 -  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 阅读全文
posted @ 2022-01-24 10:13 Angels_of_Death 阅读(96) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-01-23 16:05 Angels_of_Death 阅读(30) 评论(0) 推荐(0)
摘要: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() - 阅读全文
posted @ 2022-01-23 14:33 Angels_of_Death 阅读(35) 评论(0) 推荐(0)
摘要:A class Solution { public: int countElements(vector<int>& nums) { int minn = 0x3f3f3f3f, maxx = 0xcfcfcfcf; for (auto x : nums) minn = min(minn, x), m 阅读全文
posted @ 2022-01-23 12:01 Angels_of_Death 阅读(28) 评论(0) 推荐(0)
摘要: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", 阅读全文
posted @ 2022-01-22 21:53 Angels_of_Death 阅读(43) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2022-01-22 16:53 Angels_of_Death 阅读(342) 评论(0) 推荐(0)