結果

問題 No.29 パワーアップ
ユーザー 2329 N2329 N
提出日時 2020-09-04 18:20:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 112 ms
コンパイル使用メモリ 10,748 KB
実行使用メモリ 8,704 KB
最終ジャッジ日時 2023-08-17 12:56:25
合計ジャッジ時間 1,619 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,596 KB
testcase_01 AC 20 ms
8,580 KB
testcase_02 AC 20 ms
8,616 KB
testcase_03 WA -
testcase_04 AC 19 ms
8,652 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 19 ms
8,520 KB
testcase_09 AC 19 ms
8,516 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 18 ms
8,480 KB
testcase_21 AC 19 ms
8,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections

n = int(input())
itm = []
for i in  range(n):
   itm += (list(map(int, input().split())))

c = collections.Counter(itm)


p_1 = sum([ c[i]//2 for i in c if c[i]%2==0 ])

p_2 = sum([ c[i]//2 for i in c if c[i]%3==0 ])

p_3 = sum([ c[i]%2 for i in c if c[i]%3==0 ])
p_4 = sum([ c[i] for i in c if c[i]==1 ])
p_5 = (p_3 + p_4)//4

print(p_1 + p_2 + p_5)
0