답안 #163826

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
163826 2019-11-15T14:44:11 Z boolodifjenula Izbori (COCI17_izbori) Python 3
48 / 80
57 ms 3556 KB
N,M,K=map(int,input().split())
L=[]
G=M*[0]
for i in range (N):
    L+=[list(map(int,input().split()))]
    G[L[i][0]-1]+=1
n=0
for i in range(M):
    if G[i]>G[n]:
        n=i
print(n+1)
if n+1==K:
    print(0)
else:
    p=0
    P=[0]
    for i in range(100):
        p+=1
        P+=[n+1]
        G=M*[0]
        for x in range(N):
            for y in range(M):
                if L[x][y] in P:
                    L[x][y]=0
                else:
                    G[L[x][y]-1]+=1
                    break
        #print(G)
        n=0
        for i in range(M):
            if G[i]>G[n]:
                n=i
        if n+1==K:
            print(p)
            break
                
                    
     
    
    
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 3428 KB Output is correct
2 Correct 27 ms 3300 KB Output is correct
3 Partially correct 57 ms 3428 KB Partially correct
4 Partially correct 28 ms 3428 KB Partially correct
5 Partially correct 27 ms 3428 KB Partially correct
6 Partially correct 26 ms 3428 KB Partially correct
7 Partially correct 27 ms 3428 KB Partially correct
8 Partially correct 26 ms 3300 KB Partially correct
9 Partially correct 28 ms 3408 KB Partially correct
10 Partially correct 28 ms 3556 KB Partially correct
11 Correct 26 ms 3428 KB Output is correct
12 Correct 27 ms 3400 KB Output is correct
13 Partially correct 28 ms 3428 KB Partially correct
14 Partially correct 27 ms 3412 KB Partially correct
15 Partially correct 26 ms 3428 KB Partially correct
16 Partially correct 56 ms 3332 KB Partially correct
17 Partially correct 26 ms 3328 KB Partially correct
18 Partially correct 28 ms 3340 KB Partially correct
19 Partially correct 27 ms 3344 KB Partially correct
20 Partially correct 28 ms 3336 KB Partially correct