結果

問題 No.2355 Unhappy Back Dance
ユーザー 👑 timitimi
提出日時 2023-06-16 23:20:24
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 715 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 86,880 KB
実行使用メモリ 167,404 KB
最終ジャッジ日時 2023-09-06 22:20:29
合計ジャッジ時間 16,091 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
167,404 KB
testcase_01 AC 66 ms
71,264 KB
testcase_02 AC 66 ms
71,616 KB
testcase_03 AC 66 ms
71,128 KB
testcase_04 AC 67 ms
71,460 KB
testcase_05 AC 69 ms
71,140 KB
testcase_06 AC 152 ms
96,240 KB
testcase_07 AC 150 ms
95,860 KB
testcase_08 AC 150 ms
95,892 KB
testcase_09 AC 152 ms
96,120 KB
testcase_10 AC 2,111 ms
96,452 KB
testcase_11 AC 2,192 ms
96,396 KB
testcase_12 AC 151 ms
96,216 KB
testcase_13 AC 152 ms
96,076 KB
testcase_14 AC 2,275 ms
96,088 KB
testcase_15 AC 66 ms
71,428 KB
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 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
AA=[]
for i in range(N):
  x,y=map(int, input().split())
  AA.append((x,y))
AA=sorted(AA,key=lambda x: x[1]) 
AA=sorted(AA,key=lambda x: x[0]) 

A=[]
for i in range(N):
  A.append((AA[i][0],AA[i][1],i))
D=[[-1]*N for _ in range(N)]
E=[0]*N
for i in range(N-1):
  for j in range(i+1,N):
    if D[i][j]==1:
      continue 
    D[i][j]=1
    x1,y1,p=A[i];x2,y2,q=A[j]
    C=[]
    C.append(A[i])
    C.append(A[j])
    for k in range(j+1,N):
      x3,y3,r=A[k]
      if (y3-y1)*(x2-x1)==(x3-x1)*(y2-y1):
        C.append(A[k])
        D[i][k]=1;D[j][k]=1
        
    if len(C)>=4:
      for _,_,a in C:
        E[a]=1
    if len(C)==3:
      E[C[0][-1]]=1
      E[C[-1][-1]]=1
print(sum(E))
    
      
0