結果

問題 No.267 トランプソート
ユーザー brthyyjpbrthyyjp
提出日時 2021-05-11 21:16:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 1,000 ms
コード長 389 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 81,652 KB
実行使用メモリ 53,356 KB
最終ジャッジ日時 2023-10-22 02:55:08
合計ジャッジ時間 2,198 ms
ジャッジサーバーID
(参考情報)
judge14 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,356 KB
testcase_01 AC 38 ms
53,356 KB
testcase_02 AC 37 ms
53,356 KB
testcase_03 AC 38 ms
53,356 KB
testcase_04 AC 39 ms
53,356 KB
testcase_05 AC 42 ms
53,356 KB
testcase_06 AC 38 ms
53,356 KB
testcase_07 AC 38 ms
53,356 KB
testcase_08 AC 38 ms
53,356 KB
testcase_09 AC 38 ms
53,356 KB
testcase_10 AC 38 ms
53,356 KB
testcase_11 AC 38 ms
53,356 KB
testcase_12 AC 38 ms
53,356 KB
testcase_13 AC 38 ms
53,356 KB
testcase_14 AC 38 ms
53,356 KB
testcase_15 AC 38 ms
53,356 KB
testcase_16 AC 38 ms
53,356 KB
testcase_17 AC 38 ms
53,356 KB
testcase_18 AC 38 ms
53,356 KB
testcase_19 AC 39 ms
53,356 KB
testcase_20 AC 38 ms
53,356 KB
testcase_21 AC 39 ms
53,356 KB
testcase_22 AC 38 ms
53,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
C = list(map(str, input().split()))

MD = {'D':0, 'C': 1, 'H':2, 'S':3}
ND = {'A': 1, 'T':10, 'J':11, 'Q':12, 'K': 13}

X = []
for mn in C:
    m = mn[0]
    m = MD[m]
    n = mn[1]
    if not n.isdigit():
        n = ND[n]
    else:
        n = int(n)
    X.append((m, n, mn))
X.sort(key=lambda x: (x[0], x[1]))
res = []
for _, _, mn in X:
    res.append(mn)
print(*res)
0