結果

問題 No.29 パワーアップ
ユーザー U SU S
提出日時 2020-03-11 22:31:50
言語 Python3
(3.11.2 + numpy 1.24.2 + scipy 1.10.1)
結果
AC  
実行時間 18 ms / 5,000 ms
コード長 227 bytes
コンパイル時間 1,144 ms
実行使用メモリ 7,736 KB
最終ジャッジ日時 2022-12-16 20:12:23
合計ジャッジ時間 2,083 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,632 KB
testcase_01 AC 16 ms
7,696 KB
testcase_02 AC 15 ms
7,680 KB
testcase_03 AC 15 ms
7,668 KB
testcase_04 AC 16 ms
7,696 KB
testcase_05 AC 17 ms
7,536 KB
testcase_06 AC 16 ms
7,684 KB
testcase_07 AC 16 ms
7,736 KB
testcase_08 AC 15 ms
7,548 KB
testcase_09 AC 16 ms
7,524 KB
testcase_10 AC 17 ms
7,684 KB
testcase_11 AC 17 ms
7,616 KB
testcase_12 AC 16 ms
7,720 KB
testcase_13 AC 17 ms
7,616 KB
testcase_14 AC 17 ms
7,528 KB
testcase_15 AC 17 ms
7,632 KB
testcase_16 AC 17 ms
7,536 KB
testcase_17 AC 16 ms
7,564 KB
testcase_18 AC 17 ms
7,536 KB
testcase_19 AC 16 ms
7,700 KB
testcase_20 AC 18 ms
7,632 KB
testcase_21 AC 16 ms
7,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = [0] * 10
for i in range(n):
    b,c,d = map(int,input().split())
    a[b-1] += 1
    a[c-1] += 1
    a[d-1] += 1
ans = 0
for i in range(10):
    ans += a[i] // 2
    a[i] %= 2
ans += sum(a) // 4
print(ans)
0