結果
問題 | No.29 パワーアップ |
ユーザー |
![]() |
提出日時 | 2020-04-05 21:29:06 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 29 ms / 5,000 ms |
コード長 | 341 bytes |
コンパイル時間 | 78 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-07-04 04:04:43 |
合計ジャッジ時間 | 1,378 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
n = int(input()) s = [0 for _ in range(10)] #s=[0,0,0,0,...,0](len=10) count = 0 for i in range(n): a=list(map(int,input().split())) for j in range(3): s[a[j]-1] += 1 s = sorted(s)[::-1] for i in range(10): if s[i]>=2: count += s[i]//2 s[i] = s[i]%2 s = sorted(s)[::-1] if s[7]==1: count += 2 elif s[3]==1: count += 1 print(count)