Submission #5938804
Source Code Expand
#include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include <map> #include <queue> #define re read() #define ll long long using namespace std; inline int read() { int ret = 0, f = 1;char ch = getchar(); while (ch < '0' || ch >'9') {if (ch == '-') f = -f; ch = getchar();} while (ch >= '0' && ch <= '9') ret =ret * 10 + ch - '0', ch = getchar(); return ret*f; } int n; int ans = -0x7fffffff / 3; string ans_char; int sum; int num[51]; string judge[51]; void add(string a) { int flag = 0; for(int i = 1; i <= sum; i++) if(judge[i] == a) { num[i]++; return; } num[++sum] = 1; judge[sum] = a; } int main() { //freopen(".in","r",stdin); //freopen(".out","w",stdout); n = re; for(int i = 1; i <= n; i++) { string s; cin >> s; add(s); } for(int i = 1; i <= sum; i++) if(num[i] > ans) ans = max(ans, num[i]), ans_char = judge[i]; cout << ans_char; //fclose(stdin); //fclose(stdout); return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - 投票 |
User | luogu_bot5 |
Language | C++ (GCC 5.4.1) |
Score | 0 |
Code Size | 1033 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | sample_01.txt, sample_02.txt, sample_03.txt, case_01.txt, case_02.txt, case_03.txt, case_04.txt, case_05.txt, case_06.txt, case_07.txt, case_08.txt, case_09.txt, case_10.txt, case_11.txt, case_12.txt, case_13.txt, case_14.txt, case_15.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
case_01.txt | WA | 1 ms | 256 KB |
case_02.txt | WA | 1 ms | 256 KB |
case_03.txt | WA | 1 ms | 256 KB |
case_04.txt | WA | 1 ms | 256 KB |
case_05.txt | WA | 1 ms | 256 KB |
case_06.txt | WA | 1 ms | 256 KB |
case_07.txt | WA | 1 ms | 256 KB |
case_08.txt | WA | 1 ms | 256 KB |
case_09.txt | WA | 1 ms | 256 KB |
case_10.txt | WA | 1 ms | 256 KB |
case_11.txt | WA | 1 ms | 256 KB |
case_12.txt | WA | 1 ms | 256 KB |
case_13.txt | WA | 1 ms | 256 KB |
case_14.txt | WA | 1 ms | 256 KB |
case_15.txt | WA | 1 ms | 256 KB |
sample_01.txt | WA | 1 ms | 256 KB |
sample_02.txt | WA | 1 ms | 256 KB |
sample_03.txt | WA | 1 ms | 256 KB |