Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises) A. Fraction
来源:互联网 发布:python教程视频教程 编辑:程序博客网 时间:2024/06/05 02:58
不太看得懂题目....好像是求gcd?
#include<bits/stdc++.h>using namespace std;int gcd(int a,int b){return b==0?a:gcd(b,a%b);}int main(){int n;while(cin>>n){for(int i=n/2;i>=1;i--){int x=i;int y=n-i;if(gcd(x,y)==1){cout<<x<<' '<<y<<endl;break;}}}}
阅读全文
0 0
- Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises) A. Fraction
- Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises)
- Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises)
- Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises)
- Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises)
- Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises)
- Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises) A,B,C
- Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises) A—C题解
- Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises) B. Maxim Buys an Apartment
- Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises)题解
- Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises) C Planning
- Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises)C. Planning
- Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises) D. Jury Meeting(贪心)
- Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises) C. Planning(并查集)
- Jury Meeting Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises)(贪心,预处理?)
- Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises) ABC
- Codeforces Round #433(Div. 1,based on Olympiad of Metropolises)A Planning B Jury Meeting C Boredom
- Codeforces Round #433 (Div. 1, based on Olympiad of Metropolises) C. Boredom
- PHP文件系统
- Python3爬虫之图片防盗链破解
- (CodeForces
- 机器学习笔记-分类和聚类基本概念
- cdh5.8.3集成solr4.10.3创建core时报错 Could not start Solr. Check solr/home property and the logs
- Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises) A. Fraction
- substance.jar
- Codeforces Round #433 (Div. 2, based on Olympiad of Metropolises) B. Maxim Buys an Apartment
- ORACLE除数为0报错需处理与null值处理小记
- java学习第20天
- (CodeForces
- Redis 在Linux下的基本安装和使用
- Listview 多条目展示_适配器
- jQueryday04(下拉菜单完全 dom对象和jQuery对象相互转换)