【2022neuoj刷题记录】
2022/1/14 6:09:20
本文主要是介绍【2022neuoj刷题记录】,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
最近neuoj加了一些atcoder的题,正好在刷题,存一下代码
2581
点击查看代码
//Author:Fczhao //Language:cpp #include <bits/stdc++.h> using namespace std; signed main(){ #ifdef FCZHAO freopen("1.in", "r", stdin); freopen("1.out", "w", stdout); #endif ios::sync_with_stdio(false); int a[3]; for(int i = 0; i < 3; i++) cin >> a[i]; sort(a, a + 3, greater<int>()); cout << a[0] * 10 + a[1] + a[2] << endl; return 0; }
2582
点击查看代码
//Author:Fczhao //Language:cpp #include <bits/stdc++.h> using namespace std; signed main(){ #ifdef FCZHAO freopen("1.in", "r", stdin); freopen("1.out", "w", stdout); #endif ios::sync_with_stdio(false); int n, m; cin >> n >> m; vector<int> x(n + 1), y(m + 1); cin >> x[0] >> y[0]; for(int i = 1; i <= n; i++) cin >> x[i]; for(int i = 1; i <= m; i++) cin >> y[i]; sort(x.begin(), x.end(), greater<int>()); sort(y.begin(), y.end()); if(x[0] < y[0]) cout << "No War" << endl; else cout << "War" << endl; return 0; }
2583
点击查看代码
//Author:Fczhao //Language:cpp #include <bits/stdc++.h> using namespace std; signed main(){ #ifdef FCZHAO freopen("1.in", "r", stdin); freopen("1.out", "w", stdout); #endif int n, a, b; cin >> n >> a >> b; if(n == 1) puts("Hello World"); else cout << a + b << endl; return 0; }
2584
点击查看代码
//Author:Fczhao //Language:cpp #include <bits/stdc++.h> using namespace std; bool solve() { string s, t; cin >> s >> t; int a[26], b[26]; memset(a, -1, sizeof(a)); memset(b, -1, sizeof(b)); for(int i = 0; i < s.length(); i++) { if(a[s[i] - 'a'] == -1) a[s[i] - 'a'] = t[i] - 'a'; if(b[t[i] - 'a'] == -1) b[t[i] - 'a'] = s[i] - 'a'; if(a[s[i] - 'a'] != -1 && a[s[i] - 'a'] != t[i] - 'a') return false; if(b[t[i] - 'a'] != -1 && b[t[i] - 'a'] != s[i] - 'a') return false; } return true; } signed main(){ cout << (solve() ? "Yes" : "No") << endl; return 0; }
这篇关于【2022neuoj刷题记录】的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-20测试人员都是画画大神,让我看看谁还不会用代码图?
- 2024-05-20年薪百万的程序员都在用的摸鱼方式……
- 2024-05-19永别了,微服务架构!
- 2024-05-15鸿蒙生态设备数量超8亿台
- 2024-05-13TiDB + ES:转转业财系统亿级数据存储优化实践
- 2024-05-09“2024鸿蒙零基础快速实战-仿抖音App开发(ArkTS版)”实战课程已上线
- 2024-05-09聊聊如何通过arthas-tunnel-server来远程管理所有需要arthas监控的应用
- 2024-05-09log4j2这么配就对了
- 2024-05-09nginx修改Content-Type
- 2024-05-09Redis多数据源,看这篇就够了