标签:time tor 根据 hint ble 思路 memory ted bottom
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 4617 Accepted Submission(s): 2299
#include <iostream> #include<math.h> #include <iomanip> #include<cstdio> #include<string> #include<map> #include<vector> #include<list> #include<algorithm> #include<stdlib.h> #include<iterator> #include<sstream> #include<string.h> #include<stdio.h> using namespace std; long long gcd(long long a,long long b) { long long big=a; long long smal=b; long long ck; if(big<smal) { ck=a; a=b; b=a; } long long temp; while(smal>0) { temp=big%smal; big=smal; smal=temp; } return big; } long long gys(long long a,long long b) { long long kk; long long ak=a; long long bk=b; kk=ak*bk/gcd(ak,bk); return kk; } int main() { int m,n; while(cin>>m>>n) { int temp=gcd(m,n); cout<<m+n-temp<<endl; } return 0; }
标签:time tor 根据 hint ble 思路 memory ted bottom
原文地址:http://www.cnblogs.com/William-xh/p/7203398.html