Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
19 მარტს დამუშავებული
https://www.e-olymp.com/en/contests/5586/problems/43800 #include <iostream> using namespace std; long GCD(long N,long M) { if(M==0)return N; return GCD(M,N%M); } int main() { int N,M,P; cin>>N>>P; while(--N) { cin>>M; P=GCD(P,M); } cout<<P; } https://www.e-olymp.com/en/problems/136 #include <iostream> using namespace std; unsigned GCD(unsigned N,unsigned M) { if(M==0)return N; return GCD(M,N%M); } int main() { long x1,y1,x2,y2; unsigned X,Y; cin>>x1>>y1>>x2>>y2; X=abs(x1-x2); Y=abs(y1-y2); cout<<GCD(X,Y)-1+2; }
run
|
edit
|
history
|
help
0
stlsizeof.cc
27
Funny Saying
Dar
задача new
Following order Indegree
Day3
map_find
string iteration performance
Regression Line