結果

問題 No.3042 本棚
ユーザー kobaya0514kobaya0514
提出日時 2019-04-03 13:46:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 617 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 10,916 KB
実行使用メモリ 8,708 KB
最終ジャッジ日時 2023-09-10 10:32:14
合計ジャッジ時間 1,841 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,588 KB
testcase_01 AC 18 ms
8,596 KB
testcase_02 AC 21 ms
8,656 KB
testcase_03 AC 20 ms
8,592 KB
testcase_04 AC 19 ms
8,520 KB
testcase_05 AC 19 ms
8,540 KB
testcase_06 AC 19 ms
8,704 KB
testcase_07 AC 20 ms
8,708 KB
testcase_08 AC 20 ms
8,568 KB
testcase_09 AC 19 ms
8,528 KB
testcase_10 AC 19 ms
8,596 KB
testcase_11 AC 19 ms
8,528 KB
testcase_12 AC 19 ms
8,560 KB
testcase_13 AC 19 ms
8,524 KB
testcase_14 AC 18 ms
8,564 KB
testcase_15 AC 19 ms
8,588 KB
testcase_16 AC 19 ms
8,560 KB
testcase_17 AC 19 ms
8,592 KB
testcase_18 AC 19 ms
8,520 KB
testcase_19 AC 19 ms
8,564 KB
testcase_20 AC 19 ms
8,588 KB
testcase_21 AC 19 ms
8,600 KB
testcase_22 AC 18 ms
8,572 KB
testcase_23 AC 19 ms
8,572 KB
testcase_24 AC 19 ms
8,644 KB
testcase_25 AC 19 ms
8,656 KB
testcase_26 AC 19 ms
8,636 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

N=int(input())
S=defaultdict(list)
A=([])

for i in range(N):
    t,id=map(str,input().split())
    if id == "iti":
        S[t].append(1)
    elif id =="ni":
        S[t].append(2)
    elif id =="san":
        S[t].append(3)
    else:
        S[t].append(4)
    A.append(t)

A=list(set(A))
A.sort()

for a in A:
    if len(S[a]) > 1:
        S[a].sort()
    for i in range(len(S[a])):
        if S[a][i]==1:
            print(a,"iti")
        elif S[a][i]==2:
            print(a,"ni")
        elif S[a][i]==3:
            print(a,"san")
        else:
            print(a,"yon")
0