結果

問題 No.29 パワーアップ
ユーザー ok_adachi_jpok_adachi_jp
提出日時 2017-11-07 16:24:58
言語 Python3
(3.10.1 + numpy 1.22.3 + scipy 1.8.0)
結果
AC  
実行時間 14 ms / 5,000 ms
コード長 500 bytes
コンパイル時間 59 ms
使用メモリ 7,752 KB
最終ジャッジ日時 2022-12-29 02:23:09
合計ジャッジ時間 1,528 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 14 ms
7,712 KB
testcase_01 AC 14 ms
7,552 KB
testcase_02 AC 14 ms
7,624 KB
testcase_03 AC 14 ms
7,688 KB
testcase_04 AC 13 ms
7,680 KB
testcase_05 AC 14 ms
7,636 KB
testcase_06 AC 14 ms
7,740 KB
testcase_07 AC 14 ms
7,752 KB
testcase_08 AC 14 ms
7,740 KB
testcase_09 AC 13 ms
7,680 KB
testcase_10 AC 14 ms
7,700 KB
testcase_11 AC 14 ms
7,592 KB
testcase_12 AC 14 ms
7,556 KB
testcase_13 AC 14 ms
7,548 KB
testcase_14 AC 14 ms
7,548 KB
testcase_15 AC 14 ms
7,664 KB
testcase_16 AC 14 ms
7,560 KB
testcase_17 AC 13 ms
7,680 KB
testcase_18 AC 13 ms
7,640 KB
testcase_19 AC 14 ms
7,688 KB
testcase_20 AC 14 ms
7,640 KB
testcase_21 AC 14 ms
7,684 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

def main():
    
    N = int(input())
    history = list()
    for i in range(N):
        history.extend(list(map(int, input().split())))

    ans = 0
    for i in range(1, 11):
        duplicated = int(history.count(i) / 2)
        ans = ans + duplicated
        for n in range(duplicated * 2):
            history.remove(i)
        
    remains = len(history)
    if remains >= 4:
       ans = ans + int(remains / 4) 

    print(ans)

if __name__ == '__main__':
    main()
0