답안 #163820

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
163820 2019-11-15T14:35:35 Z boolodifjenula Izbori (COCI17_izbori) Python 3
48 / 80
55 ms 3456 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]
        G[n]=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
        n=0
        for i in range(M):
            if G[i]>G[n]:
                n=i
        if n+1==K:
            print(p)
            break
                
                    
     
    
    
# 결과 실행 시간 메모리 Grader output
1 Partially correct 48 ms 3456 KB Partially correct
2 Partially correct 25 ms 3300 KB Partially correct
3 Correct 26 ms 3428 KB Output is correct
4 Partially correct 27 ms 3336 KB Partially correct
5 Correct 26 ms 3428 KB Output is correct
6 Partially correct 35 ms 3428 KB Partially correct
7 Partially correct 40 ms 3428 KB Partially correct
8 Partially correct 25 ms 3428 KB Partially correct
9 Partially correct 27 ms 3428 KB Partially correct
10 Partially correct 27 ms 3336 KB Partially correct
11 Correct 26 ms 3332 KB Output is correct
12 Partially correct 27 ms 3428 KB Partially correct
13 Partially correct 48 ms 3328 KB Partially correct
14 Partially correct 27 ms 3428 KB Partially correct
15 Partially correct 27 ms 3428 KB Partially correct
16 Partially correct 28 ms 3428 KB Partially correct
17 Correct 26 ms 3428 KB Output is correct
18 Partially correct 29 ms 3336 KB Partially correct
19 Partially correct 50 ms 3336 KB Partially correct
20 Partially correct 55 ms 3328 KB Partially correct