結果

問題 No.29 パワーアップ
ユーザー vwxyzvwxyz
提出日時 2021-07-06 21:43:23
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 255 ms / 5,000 ms
コード長 903 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 87,376 KB
実行使用メモリ 91,936 KB
最終ジャッジ日時 2023-09-14 04:31:23
合計ジャッジ時間 7,136 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 254 ms
91,600 KB
testcase_01 AC 246 ms
91,888 KB
testcase_02 AC 242 ms
91,568 KB
testcase_03 AC 242 ms
91,536 KB
testcase_04 AC 249 ms
91,516 KB
testcase_05 AC 242 ms
91,792 KB
testcase_06 AC 242 ms
91,788 KB
testcase_07 AC 239 ms
91,532 KB
testcase_08 AC 250 ms
91,724 KB
testcase_09 AC 248 ms
91,616 KB
testcase_10 AC 241 ms
91,936 KB
testcase_11 AC 243 ms
91,868 KB
testcase_12 AC 249 ms
91,496 KB
testcase_13 AC 249 ms
91,548 KB
testcase_14 AC 245 ms
91,596 KB
testcase_15 AC 247 ms
91,816 KB
testcase_16 AC 254 ms
91,928 KB
testcase_17 AC 255 ms
91,712 KB
testcase_18 AC 243 ms
91,792 KB
testcase_19 AC 245 ms
91,788 KB
testcase_20 AC 246 ms
91,796 KB
testcase_21 AC 242 ms
91,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
import copy
import decimal
import fractions
import heapq
import itertools
import math
import random
import sys
from collections import Counter, deque,defaultdict
from functools import lru_cache,reduce
from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max
def _heappush_max(heap,item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappushpop_max(heap, item):
    if heap and item < heap[0]:
        item, heap[0] = heap[0], item
        heapq._siftup_max(heap, 0)
    return item
from math import gcd as GCD
read=sys.stdin.read
readline=sys.stdin.readline
readlines=sys.stdin.readlines

N=int(readline())
items=[0]*10
for _ in range(N):
    a,b,c=map(int,readline().split())
    a-=1;b-=1;c-=1
    items[a]+=1
    items[b]+=1
    items[c]+=1
ans=0
for i in range(10):
    ans+=items[i]//2
    items[i]%=2
ans+=sum(items)//4
print(ans)
0