結果

問題 No.29 パワーアップ
ユーザー mnrmnr
提出日時 2020-02-26 19:26:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 32 ms / 5,000 ms
コード長 771 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 12,928 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-04-21 16:32:26
合計ジャッジ時間 1,590 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
11,008 KB
testcase_01 AC 32 ms
11,008 KB
testcase_02 AC 32 ms
11,008 KB
testcase_03 AC 32 ms
11,008 KB
testcase_04 AC 32 ms
10,880 KB
testcase_05 AC 31 ms
11,008 KB
testcase_06 AC 32 ms
11,008 KB
testcase_07 AC 30 ms
11,008 KB
testcase_08 AC 31 ms
11,008 KB
testcase_09 AC 31 ms
11,008 KB
testcase_10 AC 32 ms
11,008 KB
testcase_11 AC 31 ms
11,008 KB
testcase_12 AC 31 ms
10,880 KB
testcase_13 AC 31 ms
10,880 KB
testcase_14 AC 31 ms
11,008 KB
testcase_15 AC 31 ms
10,880 KB
testcase_16 AC 31 ms
10,880 KB
testcase_17 AC 31 ms
11,008 KB
testcase_18 AC 30 ms
11,008 KB
testcase_19 AC 30 ms
11,008 KB
testcase_20 AC 31 ms
11,008 KB
testcase_21 AC 31 ms
11,008 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