結果

問題 No.29 パワーアップ
ユーザー mnrmnr
提出日時 2020-02-26 19:26:50
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 771 bytes
コンパイル時間 73 ms
使用メモリ 7,976 KB
最終ジャッジ日時 2022-12-07 06:36:13
合計ジャッジ時間 1,628 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 16 ms
7,976 KB
testcase_01 AC 16 ms
7,812 KB
testcase_02 AC 16 ms
7,728 KB
testcase_03 AC 16 ms
7,760 KB
testcase_04 AC 15 ms
7,840 KB
testcase_05 AC 16 ms
7,760 KB
testcase_06 AC 17 ms
7,824 KB
testcase_07 AC 16 ms
7,928 KB
testcase_08 AC 16 ms
7,864 KB
testcase_09 AC 17 ms
7,816 KB
testcase_10 AC 16 ms
7,920 KB
testcase_11 AC 17 ms
7,916 KB
testcase_12 AC 16 ms
7,812 KB
testcase_13 AC 17 ms
7,920 KB
testcase_14 AC 17 ms
7,868 KB
testcase_15 AC 17 ms
7,740 KB
testcase_16 AC 16 ms
7,824 KB
testcase_17 AC 16 ms
7,816 KB
testcase_18 AC 16 ms
7,864 KB
testcase_19 AC 16 ms
7,736 KB
testcase_20 AC 16 ms
7,764 KB
testcase_21 AC 16 ms
7,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
N = int(input())
L = []
for i in range(N):
    a, b, c = map(int, input().split())
    L.append(a)
    L.append(b)
    L.append(c)

c = []
for i in range(10):
    c.append(0)

for i in range(3*N):
    if L[i] == 1:
        c[0] += 1
    elif L[i] == 2:
        c[1] += 1
    elif L[i] == 3:
        c[2] += 1
    elif L[i] == 4:
        c[3] += 1
    elif L[i] == 5:
        c[4] += 1
    elif L[i] == 6:
        c[5] += 1
    elif L[i] == 7:
        c[6] += 1
    elif L[i] == 8:
        c[7] += 1
    elif L[i] == 9:
        c[8] += 1
    elif L[i] == 10:
        c[9] += 1
        
cnt = 0
for i in range(10):
    while c[i] >= 2:
        c[i] -= 2
        cnt += 1
n = 0
for i in range(10):
    n += c[i]
if n > 3:
    cnt += math.floor(n / 4)

print(cnt)
0