結果

問題 No.2153 何コーダーが何人?
ユーザー dangodango
提出日時 2023-06-05 20:26:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 434 bytes
コンパイル時間 185 ms
コンパイル使用メモリ 10,740 KB
実行使用メモリ 8,376 KB
最終ジャッジ日時 2023-08-28 09:42:40
合計ジャッジ時間 1,807 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,908 KB
testcase_01 AC 17 ms
7,760 KB
testcase_02 AC 17 ms
7,696 KB
testcase_03 AC 17 ms
8,176 KB
testcase_04 AC 17 ms
8,208 KB
testcase_05 AC 16 ms
8,216 KB
testcase_06 AC 17 ms
8,348 KB
testcase_07 AC 17 ms
8,212 KB
testcase_08 AC 17 ms
7,760 KB
testcase_09 AC 18 ms
8,288 KB
testcase_10 AC 18 ms
8,336 KB
testcase_11 AC 19 ms
8,240 KB
testcase_12 AC 17 ms
7,892 KB
testcase_13 AC 18 ms
8,336 KB
testcase_14 AC 17 ms
8,284 KB
testcase_15 AC 17 ms
7,880 KB
testcase_16 AC 18 ms
8,220 KB
testcase_17 AC 18 ms
8,376 KB
testcase_18 AC 18 ms
8,304 KB
testcase_19 AC 16 ms
7,780 KB
testcase_20 AC 15 ms
7,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
declarations = []
for i in range(N):
  INPUT = input().split()
  S, C = INPUT[0], int(INPUT[1])
  declarations.append((S, C))
coder_count = [0] * 8
coder_color = {}

for name, color in declarations:
    if name in coder_color:
        old_color = coder_color[name]
        coder_count[old_color] -= 1
    coder_color[name] = color
    coder_count[color] += 1

for i, count in enumerate(coder_count):
    print(count)
0