Codeforces Round #198 (Div. 2)(未完待续)
来源:互联网 发布:淘宝怎么引流量 编辑:程序博客网 时间:2024/05/17 06:48
A - The Wall
找出最小公倍数,然后看在这个区间内有多少个
#include<iostream>#include<cstdio>using namespace std;int gcd(int x,int y){ if(y==0)return x; return gcd(y,x%y);}int lcm(int x,int y){ return x*y/gcd(x,y);}int main(){ int x,y,a,b; cin>>x>>y>>a>>b; int g=lcm(x,y); int ans=b/g-a/g; if(a%g==0)ans++; cout<<ans<<endl; return 0;}
0 0
- Codeforces Round #198 (Div. 2)(未完待续)
- Codeforces Round #331 (Div. 2)【未完待续】
- Codeforces Round #382 (Div. 2)(A-D 未完)
- Codeforces Round #392 (Div. 2) 题解(待续)
- Codeforces Round #398 (Div. 2) 题解(待续)
- Codeforces Round #401 (Div. 2) 题解 (待续)
- Codeforces Round #404 (Div. 2) 题解(待续)
- Codeforces Round #411 (Div. 2)(A-D 未完)
- Codeforces Round #FF (Div. 2)(A-D 未完)
- Codeforces Round #403 (Div. 2)(A-E 未完)
- Codeforces AIM Tech Round 3 (Div. 2)(A-D 未完)
- Codeforces Round #229 (Div. 2)(C,E待续)
- Codeforces Round #402 (Div. 1) 题解(待续)
- UESTC 2016 Summer Training #2 Div.2(未完待续)
- UESTC 2016 Summer Training #1 Div.2(未完待续)
- UESTC 2016 Summer Training #3 Div.2(未完待续)
- UESTC 2016 Summer Training #4 Div.2(未完待续)
- UESTC 2016 Summer Training #5 Div.2(未完待续)
- Serializable序列化(二)
- 简述decode(comm,null,0,comm)
- 软件分层设计
- Win32
- 黑马程序员------枚举器
- Codeforces Round #198 (Div. 2)(未完待续)
- C语言 system函数
- TAB带地线滑动效果(类似QQ)
- 使用notepad ++快速编译c++程序 !
- BeanFactory与ApplicationContext随记
- 【闲谈】应聘时要问HR的7个问题
- System V 的IPC机制
- CF-395A1 Skis (two pointer)
- 记录一下,从菜鸟做起