結果
問題 | No.1265 Balloon Survival |
ユーザー | Coki628 |
提出日時 | 2020-12-05 01:53:44 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,270 bytes |
コンパイル時間 | 307 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 146,928 KB |
最終ジャッジ日時 | 2024-09-15 09:54:01 |
合計ジャッジ時間 | 17,597 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 41 ms
52,608 KB |
testcase_01 | AC | 42 ms
52,608 KB |
testcase_02 | AC | 43 ms
52,608 KB |
testcase_03 | AC | 42 ms
52,992 KB |
testcase_04 | AC | 42 ms
52,608 KB |
testcase_05 | AC | 42 ms
53,504 KB |
testcase_06 | AC | 43 ms
53,120 KB |
testcase_07 | AC | 43 ms
52,736 KB |
testcase_08 | AC | 43 ms
52,736 KB |
testcase_09 | AC | 43 ms
52,864 KB |
testcase_10 | AC | 42 ms
52,864 KB |
testcase_11 | AC | 43 ms
53,248 KB |
testcase_12 | AC | 43 ms
52,864 KB |
testcase_13 | AC | 42 ms
52,992 KB |
testcase_14 | AC | 175 ms
84,096 KB |
testcase_15 | AC | 147 ms
83,328 KB |
testcase_16 | AC | 81 ms
68,480 KB |
testcase_17 | AC | 621 ms
109,824 KB |
testcase_18 | AC | 99 ms
72,320 KB |
testcase_19 | AC | 85 ms
68,992 KB |
testcase_20 | AC | 171 ms
84,224 KB |
testcase_21 | AC | 329 ms
97,920 KB |
testcase_22 | AC | 212 ms
84,992 KB |
testcase_23 | AC | 228 ms
85,760 KB |
testcase_24 | AC | 1,335 ms
146,348 KB |
testcase_25 | AC | 1,350 ms
146,672 KB |
testcase_26 | AC | 1,360 ms
146,928 KB |
testcase_27 | AC | 1,351 ms
146,668 KB |
testcase_28 | AC | 1,342 ms
146,924 KB |
testcase_29 | AC | 1,368 ms
146,916 KB |
testcase_30 | AC | 1,308 ms
146,924 KB |
testcase_31 | AC | 1,294 ms
146,664 KB |
testcase_32 | AC | 1,326 ms
146,668 KB |
testcase_33 | AC | 1,313 ms
146,536 KB |
testcase_34 | AC | 44 ms
53,632 KB |
testcase_35 | WA | - |
ソースコード
import sys from math import hypot from operator import itemgetter def input(): return sys.stdin.readline().strip() def list2d(a, b, c): return [[c] * b for i in range(a)] def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)] def list4d(a, b, c, d, e): return [[[[e] * d for k in range(c)] for j in range(b)] for i in range(a)] def ceil(x, y=1): return int(-(-x // y)) def INT(): return int(input()) def MAP(): return map(int, input().split()) def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)] def Yes(): print('Yes') def No(): print('No') def YES(): print('YES') def NO(): print('NO') sys.setrecursionlimit(10**9) INF = 10**19 MOD = 10**9 + 7 EPS = 10**-10 N = INT() XY = [()] * N for i in range(N): x, y = MAP() XY[i] = (x, y) edges = [] for i, (x, y) in enumerate(XY): for j, (x2, y2) in enumerate(XY[i+1:], i+1): dist = hypot(x-x2, y-y2) / 2 edges.append((dist, i, j)) edges.sort(key=itemgetter(0)) removed = [0] * N ans = 0 for dist, a, b in edges: if removed[a] or removed[b]: continue if a == 0: ans += 1 removed[b] = 1 elif b == 0: ans += 1 removed[a] = 1 else: removed[a] = 1 removed[b] = 1 print(ans)