Submission #163819

# Submission time Handle Problem Language Result Execution time Memory
163819 2019-11-15T14:34:05 Z boolodifjenula Izbori (COCI17_izbori) Python 3
44 / 80
31 ms 3464 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[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
                
                    
     
    
    
# Verdict Execution time Memory Grader output
1 Partially correct 26 ms 3464 KB Partially correct
2 Partially correct 26 ms 3300 KB Partially correct
3 Partially correct 26 ms 3400 KB Partially correct
4 Partially correct 26 ms 3336 KB Partially correct
5 Partially correct 26 ms 3336 KB Partially correct
6 Partially correct 26 ms 3332 KB Partially correct
7 Partially correct 26 ms 3400 KB Partially correct
8 Partially correct 26 ms 3428 KB Partially correct
9 Partially correct 27 ms 3332 KB Partially correct
10 Partially correct 31 ms 3348 KB Partially correct
11 Correct 26 ms 3328 KB Output is correct
12 Correct 26 ms 3336 KB Output is correct
13 Partially correct 27 ms 3324 KB Partially correct
14 Partially correct 27 ms 3428 KB Partially correct
15 Partially correct 26 ms 3396 KB Partially correct
16 Partially correct 26 ms 3336 KB Partially correct
17 Partially correct 26 ms 3336 KB Partially correct
18 Partially correct 27 ms 3428 KB Partially correct
19 Partially correct 27 ms 3428 KB Partially correct
20 Partially correct 28 ms 3464 KB Partially correct