結果

問題 No.29 パワーアップ
ユーザー mnrmnr
提出日時 2020-02-26 19:26:50
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 771 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,812 KB
実行使用メモリ 8,156 KB
最終ジャッジ日時 2023-08-03 18:23:22
合計ジャッジ時間 1,352 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,040 KB
testcase_01 AC 16 ms
8,156 KB
testcase_02 AC 17 ms
8,052 KB
testcase_03 AC 17 ms
8,044 KB
testcase_04 AC 17 ms
7,972 KB
testcase_05 AC 16 ms
8,036 KB
testcase_06 AC 16 ms
8,012 KB
testcase_07 AC 16 ms
8,040 KB
testcase_08 AC 16 ms
8,156 KB
testcase_09 AC 15 ms
8,040 KB
testcase_10 AC 15 ms
8,100 KB
testcase_11 AC 16 ms
8,048 KB
testcase_12 AC 16 ms
8,004 KB
testcase_13 AC 16 ms
8,060 KB
testcase_14 AC 16 ms
8,152 KB
testcase_15 AC 16 ms
8,080 KB
testcase_16 AC 16 ms
8,108 KB
testcase_17 AC 16 ms
7,976 KB
testcase_18 AC 15 ms
8,136 KB
testcase_19 AC 16 ms
7,960 KB
testcase_20 AC 15 ms
7,968 KB
testcase_21 AC 16 ms
8,052 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