結果

問題 No.1121 Social Distancing in Cinema
ユーザー tyawanmusityawanmusi
提出日時 2020-07-22 22:12:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 606 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 130,844 KB
最終ジャッジ日時 2023-09-04 20:59:46
合計ジャッジ時間 8,992 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
82,276 KB
testcase_01 AC 103 ms
77,780 KB
testcase_02 AC 103 ms
77,944 KB
testcase_03 AC 103 ms
77,928 KB
testcase_04 AC 104 ms
77,808 KB
testcase_05 AC 105 ms
77,704 KB
testcase_06 AC 104 ms
78,028 KB
testcase_07 AC 103 ms
77,904 KB
testcase_08 AC 146 ms
82,960 KB
testcase_09 AC 140 ms
81,860 KB
testcase_10 AC 161 ms
82,684 KB
testcase_11 AC 163 ms
82,876 KB
testcase_12 AC 187 ms
83,768 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
b=[500*[0]for _ in range(500)]
xy=[list(map(lambda x:int(x)-1,input().split()))for _ in range(n)]
for i in range(n):
  x,y=xy[i]
  xy[i]=((x**2+y**2)**0.5,x,y,i)
xy.sort()
ans=[]
dxx=[1,0,-1,0]
dyy=[0,1,0,-1]
dxy=zip(dxx,dyy)
for _,sx,sy,i in xy:
  if b[sx][sy]:continue
  ans.append(i+1)
  stack=[(sx,sy)]
  for x,y in stack:
    b[x][y]=1
    for dx,dy in zip(dxx,dyy):
      if ((sx-(x+dx))**2+(sy-(y+dy))**2)**0.5>10:continue
      if not(0<=x+dx<500):continue
      if not(0<=y+dy<500):continue
      if b[x+dx][y+dy]:continue
      stack.append((x+dx,y+dy))
print(len(ans))
print(*ans)
0