提出 #26450917


ソースコード 拡げる

N, M=map(int, input().split())
L=[]
for i in range(2*N):
    L.append([i, 0])

hand=[]
for i in range(2*N):
    A=list(input())
    hand.append(A)

for i in range(M):
    for j in range(1, N+1):
        left, l_p=L[2*j-2]
        right, r_p=L[2*j-1]
        l_h=hand[left][i]

        r_h=hand[right][i]
        if l_h=="G":
            if r_h=="C":
                L[2*j-2][1]+=1
            elif r_h=="P":
                L[2*j-1][1]+=1
        elif l_h=="C":
            if r_h=="P":
                L[2*j-2][1]+=1
            elif r_h=="G":
                L[2*j-1][1]+=1
        else:
            if r_h=="G":
                L[2*j-2][1]+=1
            elif r_h=="C":
                L[2*j-1][1]+=1


    L=sorted(L, key=lambda x: x[1]*10000+50-x[0], reverse=True)


for l in L:
    print(l[0]+1)

提出情報

提出日時
問題 C - Swiss-System Tournament
ユーザ Powell_ML
言語 PyPy3 (7.3.0)
得点 300
コード長 843 Byte
結果 AC
実行時間 75 ms
メモリ 68488 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 2
AC × 20
セット名 テストケース
Sample sample_01.txt, sample_02.txt
All hand_01.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, sample_01.txt, sample_02.txt
ケース名 結果 実行時間 メモリ
hand_01.txt AC 64 ms 61932 KiB
random_01.txt AC 73 ms 68476 KiB
random_02.txt AC 53 ms 62468 KiB
random_03.txt AC 54 ms 62492 KiB
random_04.txt AC 62 ms 67932 KiB
random_05.txt AC 75 ms 68372 KiB
random_06.txt AC 51 ms 63308 KiB
random_07.txt AC 70 ms 68276 KiB
random_08.txt AC 65 ms 68084 KiB
random_09.txt AC 72 ms 68488 KiB
random_10.txt AC 64 ms 68124 KiB
random_11.txt AC 64 ms 68036 KiB
random_12.txt AC 68 ms 68020 KiB
random_13.txt AC 61 ms 67860 KiB
random_14.txt AC 51 ms 62148 KiB
random_15.txt AC 64 ms 67748 KiB
random_16.txt AC 70 ms 67800 KiB
random_17.txt AC 64 ms 67960 KiB
sample_01.txt AC 50 ms 61804 KiB
sample_02.txt AC 52 ms 62048 KiB