标签:
[2016-03-08][codeforces][651][A][Joysticks]#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <queue> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cstdlib> #include <cctype> #include <string> #include <cstring> #include <cstdio> #include <cmath> #include <cstdlib> #include <ctime> using namespace std; typedef long long LL; #define CLR(x,y) memset((x),(y),sizeof((x))) #define FOR(x,y,z) for(int (x)=(y);(x)<(z);++(x)) #define FORD(x,y,z) for(int (x)=(y);(x)>=(z);--(x)) #define FOR2(x,y,z) int (x);for((x)=(y);(x)<(z);++(x)) #define FORD2(x,y,z) int (x);for((x)=(y);(x)>=(z);--(x)) int main(){ //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); int a1,a2,t = 0; scanf("%d%d",&a1,&a2); while(a1&&a2){ if(a1 > a2) swap(a1,a2); if(a1 == a2 && a1 == 1) break; ++a1;a2 -= 2;++t; } printf("%d\n",t); return 0; } |
[2016-03-08][codeforces][651][A][Joysticks]
标签:
原文地址:http://www.cnblogs.com/qhy285571052/p/5263913.html