题目地址:http://codeforces.com/contest/519/problem/C
1 /* 2 题意:方案:高手1和菜鸟2 或者 高手2菜鸟1 三人组队求最大组队数 3 1. 高手加菜鸟每三个分开,在n,m的数字之内 4 2. 高手多,高手2;菜鸟多,菜鸟2 比较好理解 5 */ 6 #include <cstdio> 7 #include <algorithm> 8 using namespace std; 9 10 int main(void) 11 { 12 //freopen ("C.in", "r", stdin); 13 14 int n, m; 15 16 while (~scanf ("%d%d", &n, &m)) 17 { 18 int ans = (n + m) / 3; 19 ans = min (ans, n); 20 ans = min (ans, m); 21 printf ("%d\n", ans); 22 } 23 24 return 0; 25 } 26 27 /* 28 #include <cstdio> 29 #include <algorithm> 30 using namespace std; 31 32 int main(void) 33 { 34 //freopen ("C.in", "r", stdin); 35 36 int n, m; 37 38 while (~scanf ("%d%d", &n, &m)) 39 { 40 int cnt = 0; 41 while (n && m && (n + m) >= 3) 42 { 43 if (n >= m) 44 { 45 n -= 2; m -= 1; 46 } 47 else 48 { 49 n -=1; m -= 2; 50 } 51 cnt++; 52 } 53 54 printf ("%d\n", cnt); 55 56 return 0; 57 } 58 */