結果

問題 No.29 パワーアップ
ユーザー turner18_jpturner18_jp
提出日時 2017-09-26 11:48:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 21 ms / 5,000 ms
コード長 330 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 10,680 KB
実行使用メモリ 8,084 KB
最終ジャッジ日時 2023-08-09 19:40:20
合計ジャッジ時間 1,508 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,932 KB
testcase_01 AC 16 ms
7,932 KB
testcase_02 AC 17 ms
7,916 KB
testcase_03 AC 17 ms
7,904 KB
testcase_04 AC 17 ms
7,968 KB
testcase_05 AC 16 ms
8,056 KB
testcase_06 AC 16 ms
7,964 KB
testcase_07 AC 16 ms
7,916 KB
testcase_08 AC 16 ms
7,900 KB
testcase_09 AC 16 ms
7,972 KB
testcase_10 AC 17 ms
7,904 KB
testcase_11 AC 16 ms
7,924 KB
testcase_12 AC 16 ms
7,844 KB
testcase_13 AC 16 ms
7,908 KB
testcase_14 AC 16 ms
7,920 KB
testcase_15 AC 21 ms
8,084 KB
testcase_16 AC 17 ms
7,904 KB
testcase_17 AC 16 ms
7,892 KB
testcase_18 AC 16 ms
7,900 KB
testcase_19 AC 16 ms
7,928 KB
testcase_20 AC 16 ms
7,916 KB
testcase_21 AC 16 ms
7,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
N = int(input())
li = []
match = 0
other = 0
for i in range(N):
    l = list(map(int, input().split()))
    li.extend(l)

for i in range(1,11):
    count = li.count(i)
    if count >= 2:
        match += math.floor(count / 2)
        other += count % 2
    else:
        other += count

print(int(match + (other / 4)))
0