Submission #169447


Source Code Expand

Copy
n = int(raw_input())
a = []
b = []
c = []
for i in range(n):
    a.append(str(raw_input()))
    c.append(0)

for i in range(n):
    if a[i] in b:
        c[b.index(a[i])] += 1
    else:
        b.append(a[i])
        c[b.index(a[i])] += 1

maxnum = max(c)
print b[c.index(maxnum)]

Submission Info

Submission Time
Task B - 投票
User kametaso
Language Python (2.7.3)
Score 100
Code Size 298 Byte
Status
Exec Time 65 ms
Memory 3376 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt, sample_03.txt
All 100 / 100 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 65 ms 3340 KB
case_02.txt 48 ms 3348 KB
case_03.txt 52 ms 3348 KB
case_04.txt 53 ms 3336 KB
case_05.txt 53 ms 3376 KB
case_06.txt 52 ms 3352 KB
case_07.txt 51 ms 3340 KB
case_08.txt 52 ms 3276 KB
case_09.txt 51 ms 3364 KB
case_10.txt 48 ms 3336 KB
case_11.txt 50 ms 3304 KB
case_12.txt 55 ms 3332 KB
case_13.txt 51 ms 3352 KB
case_14.txt 48 ms 3368 KB
case_15.txt 50 ms 3308 KB
sample_01.txt 49 ms 3360 KB
sample_02.txt 48 ms 3320 KB
sample_03.txt 48 ms 3368 KB