摘要: 欢迎来到我的博客 我是PHarr,常以PHarr这个ID在各大OJ闲逛 退役OI选手,现役ACM选手 毕业于焦作市解放区实验学校、焦作市外国语中学、焦作市第一中学、沁阳市第一中学 这个博客主要用来写写算法笔记,有时写点人生感悟 联系我 email : pharr.mx@outlook.com 荣誉墙 阅读全文
posted @ 2019-07-27 16:28 PHarr 阅读(362) 评论(0) 推荐(0) 编辑
摘要: 100352. 交换后字典序最小的字符串 枚举交换的位置 class Solution { public: string getSmallestString(string s) { string res = s; for (int i = 1; i < s.size(); i++) { if ((( 阅读全文
posted @ 2024-07-15 17:06 PHarr 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 3210. 找出加密后的字符串 class Solution { public: string getEncryptedString(string s, int k) { int n = s.size(); string t = s; for(int i = 0; i < n ; i ++) t[i 阅读全文
posted @ 2024-07-08 15:45 PHarr 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 1. 全国科普行动日【算法赛】 #include <iostream> using namespace std; int main() { cout << "6.29"; return 0; } 2. A%B【算法赛】 #include <bits/stdc++.h> using namespace 阅读全文
posted @ 2024-06-30 22:54 PHarr 阅读(4) 评论(0) 推荐(0) 编辑
摘要: A - Not Too Hard #include <bits/stdc++.h> using namespace std; using i32 = int32_t; using i64 = long long; #define int i64 using vi = vector<int>; i32 阅读全文
posted @ 2024-05-30 22:08 PHarr 阅读(4) 评论(0) 推荐(0) 编辑
摘要: B. String #include <bits/stdc++.h> using namespace std; using i32 = int32_t; using i64 = long long; using vi = vector<int>; i32 main(){ ios::sync_with 阅读全文
posted @ 2024-05-28 21:33 PHarr 阅读(51) 评论(0) 推荐(0) 编辑
摘要: A - Buttons #include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; int res = 0; if(a > b) res += a, a --; else res += b, 阅读全文
posted @ 2024-05-28 20:28 PHarr 阅读(9) 评论(0) 推荐(0) 编辑
摘要: A - 小苯的九宫格 #include <bits/stdc++.h> using namespace std; int main(){ vector<int> a(11); for(int i = 1; i <= 9; i ++) cin >> a[i]; string s; cin >> s; 阅读全文
posted @ 2024-05-28 17:43 PHarr 阅读(11) 评论(0) 推荐(0) 编辑
摘要: A - 欢迎来到辽宁省赛 #include <bits/stdc++.h> using namespace std; int main(){ cout << "27\n"; return 0; } B - 胜率 首先如果参加了 10000 局比赛,则一定会有当前胜率的情况出现。 所以我们枚举一下分母 阅读全文
posted @ 2024-05-14 17:50 PHarr 阅读(22) 评论(0) 推荐(0) 编辑
摘要: A-Bingbong的化学世界 #include<bits/stdc++.h> using namespace std; const int maxn = 1001; int a[maxn]; int main() { string t = "...|..."; vector<string> x(6 阅读全文
posted @ 2024-05-06 18:08 PHarr 阅读(4) 评论(0) 推荐(0) 编辑
摘要: A-小红进地下城 a = input() b = input() if a == b : print("Yes") else: print("No") B-小红打怪 #include <bits/stdc++.h> using namespace std; int main() { int n, m 阅读全文
posted @ 2024-05-06 18:02 PHarr 阅读(2) 评论(0) 推荐(0) 编辑