結果
| 問題 |
No.1265 Balloon Survival
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 16:03:47 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,026 bytes |
| コンパイル時間 | 289 ms |
| コンパイル使用メモリ | 82,688 KB |
| 実行使用メモリ | 65,792 KB |
| 最終ジャッジ日時 | 2025-06-12 16:03:51 |
| 合計ジャッジ時間 | 2,803 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 3 WA * 29 |
ソースコード
import math
def main():
import sys
input = sys.stdin.read
data = input().split()
N = int(data[0])
if N == 0:
print(0)
return
balloons = []
index = 1
for _ in range(N):
x = int(data[index])
y = int(data[index + 1])
balloons.append((x, y))
index += 2
if N == 1:
print(0)
return
count = 0
for i in range(1, N):
xi, yi = balloons[i]
d_i = math.hypot(xi - balloons[0][0], yi - balloons[0][1])
found = False
for j in range(1, N):
if i == j:
continue
xj, yj = balloons[j]
dist_ij = math.hypot(xi - xj, yi - yj)
if dist_ij < d_i:
d_j1 = math.hypot(xj - balloons[0][0], yj - balloons[0][1])
if d_j1 > dist_ij:
found = True
break
if found:
count += 1
print(N - 1 - count)
if __name__ == '__main__':
main()
gew1fw