43662023-03-27 10:12:43PallanekPéterKert (75 pont)python3Runtime error 69/75349ms67044 KiB
from sys import stdin, stdout
def main():
    m,n,p=[int(i) for i in input().split()]
    sorok=[]; mx=0; Ldb=0
    for i in range(m):
        db=0; elozo=0
        sorok.append(list(map(int, stdin.readline().split())))
        for j in range(n):
            if sorok[i][j]==elozo:
                db+=1
            else:
                elozo=sorok[i][j]; db=1
            if db>mx:
                mx=db
        if db>mx:
            mx=db
        sorok[i].sort()
        db=0; elozo=0;
        for j in range(n):
            if sorok[i][j]==elozo:
                db+=1
            else:
                if n/2<db:
                    Ldb+=1; db=1
                    break
                elozo=sorok[i][j]; db=1
        if n/2<db:
            Ldb+=1
    print(Ldb)
    print(mx)
main()
SubtaskSumTestVerdictTimeMemory
base69/75
1Accepted0/017ms11232 KiB
2Accepted0/0349ms53260 KiB
3Accepted4/417ms11680 KiB
4Accepted4/417ms11708 KiB
5Accepted4/417ms12084 KiB
6Accepted4/417ms12120 KiB
7Accepted4/417ms12196 KiB
8Accepted4/417ms12476 KiB
9Accepted4/417ms12388 KiB
10Accepted4/424ms13764 KiB
11Accepted6/618ms13112 KiB
12Accepted6/630ms14912 KiB
13Accepted6/656ms18444 KiB
14Accepted6/6349ms54056 KiB
15Runtime error0/6307ms67044 KiB
16Accepted6/6344ms54780 KiB
17Accepted7/7189ms34204 KiB