标签:des blog io os java ar strong for div
Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 360 Accepted Submission(s): 203
#include <iostream> #include <cstring> #include <cstdio> #include <string> using namespace std; int a[10010]; int cnt = 0, T, N; int main(){ scanf("%d", &T); while(T--){ memset(a, 0, sizeof(a)); cnt++; printf("Case #%d:\n", cnt); scanf("%d", &N); int temp, max = 0; int mark = N; while(N--){ scanf("%d", &temp); a[10000-(100-temp)*(100-temp)]++; } for(int i = 0; i <= 10000; i++){ if(a[i] > max) max = a[i]; } int cnt2 = 0; for(int i = 0; i <= 10000; i++){ if(a[i] == max) cnt2++; } if(cnt2*max == mark && cnt2 > 1) printf("Bad Mushroom\n"); else{ bool flag2 = false; for(int i = 0; i <= 10000; i++){ if(a[i] == max) { if(flag2 == false){ printf("%d", i); flag2 = true; } else printf(" %d", i); } } printf("\n"); } } return 0; }
标签:des blog io os java ar strong for div
原文地址:http://www.cnblogs.com/titicia/p/3986821.html