結果

問題 No.29 パワーアップ
ユーザー takakintakakin
提出日時 2020-03-29 09:53:14
言語 Python3
(3.11.2 + numpy 1.24.2 + scipy 1.10.1)
結果
AC  
実行時間 14 ms / 5,000 ms
コード長 245 bytes
コンパイル時間 50 ms
実行使用メモリ 7,740 KB
最終ジャッジ日時 2023-01-17 14:09:18
合計ジャッジ時間 1,457 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
n=int(input())
C=[0]*10
for _ in range(n):
  a,b,c=map(int,input().split())
  C[a-1]+=1
  C[b-1]+=1
  C[c-1]+=1
ans=0
rem=0
for i in range(10):
  ans+=C[i]//2
  rem+=C[i]%2
print(ans+rem//4)
0