Codeforces Round #739 (Div. 3)
2021/9/17 6:07:57
本文主要是介绍Codeforces Round #739 (Div. 3),对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
A. Dislike of Threes
B. Who's Opposite?
#include<bits/stdc++.h> using namespace std; int t, a, b, c; int main() { cin >> t; for(int i = 1; i <= t; i++) { cin >> a >> b >> c; int d = max(a, b) - min(a, b); if(a > 2 * d || b > 2 * d || c > 2 * d) cout << "-1" << endl; else if(c > d && c <= d * 2) cout << c - d << endl; else if (c + d <= d * 2) cout << c + d << endl; else cout << "-1" << endl; } return 0; }
C. Infinity Table
#include<bits/stdc++.h> using namespace std; int t, k; void deal(int x) { int i; for(i = 1; i <= 100000; i++) if(i * i >= x) break; int tmp = i * i; int temp = i * i - i + 1; if(x >= temp) cout << i << " " << tmp - x + 1 << endl; else cout << i - temp + x << " " << i << endl; } int main() { cin >> t; for(int i = 1; i <= t; i++) { cin >> k; deal(k); } return 0; }
这篇关于Codeforces Round #739 (Div. 3)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-06-30uniAPP 实现全屏左右滚动滚动的效果-icode9专业技术文章分享
- 2024-06-30如何在本地使用授权或插件-icode9专业技术文章分享
- 2024-06-30伪静态规则配置方法汇总-icode9专业技术文章分享
- 2024-06-29易优CMS安装常见问题汇总-icode9专业技术文章分享
- 2024-06-28易优新手必读安装教程-icode9专业技术文章分享
- 2024-06-28忘记eyoucms后台密码怎么办?-icode9专业技术文章分享
- 2024-06-26终极指南:Scrum中如何设置需求优先级
- 2024-06-26AI大模型企业应用实战(25)-为Langchain Agent添加记忆功能
- 2024-06-26小白家庭 nas 搭建方案-icode9专业技术文章分享
- 2024-06-23AI大模型企业应用实战(14)-langchain的Embedding