結果

問題 No.29 パワーアップ
ユーザー No-RaNo-Ra
提出日時 2017-08-13 16:23:36
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 417 bytes
コンパイル時間 75 ms
使用メモリ 7,756 KB
最終ジャッジ日時 2022-12-06 21:02:23
合計ジャッジ時間 1,762 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 17 ms
7,636 KB
testcase_01 AC 16 ms
7,556 KB
testcase_02 AC 16 ms
7,632 KB
testcase_03 AC 17 ms
7,756 KB
testcase_04 AC 16 ms
7,552 KB
testcase_05 AC 16 ms
7,640 KB
testcase_06 AC 16 ms
7,624 KB
testcase_07 AC 17 ms
7,552 KB
testcase_08 AC 17 ms
7,700 KB
testcase_09 AC 17 ms
7,564 KB
testcase_10 AC 17 ms
7,636 KB
testcase_11 AC 16 ms
7,716 KB
testcase_12 AC 17 ms
7,568 KB
testcase_13 AC 17 ms
7,660 KB
testcase_14 AC 16 ms
7,696 KB
testcase_15 AC 17 ms
7,644 KB
testcase_16 AC 16 ms
7,756 KB
testcase_17 AC 17 ms
7,588 KB
testcase_18 AC 16 ms
7,576 KB
testcase_19 AC 16 ms
7,640 KB
testcase_20 AC 16 ms
7,748 KB
testcase_21 AC 16 ms
7,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

item = [0 for i in range(10)]

for i in range(N):
    drop = input().split()
    item[int(drop[0])-1] += 1
    item[int(drop[1])-1] += 1
    item[int(drop[2])-1] += 1


def solve(item):
    Lvcount = 0
    remaining = 0
    for k in range(len(item)):
        Lvcount += item[k] // 2
        remaining += item[k] % 2
    Lvcount += remaining // 4
    return Lvcount
solve

Lv = solve(item)
print(Lv)
0