結果

問題 No.2355 Unhappy Back Dance
ユーザー 👑 timitimi
提出日時 2023-06-16 23:12:08
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 655 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 86,644 KB
実行使用メモリ 166,232 KB
最終ジャッジ日時 2023-09-06 22:06:02
合計ジャッジ時間 14,553 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
166,232 KB
testcase_01 AC 68 ms
70,844 KB
testcase_02 AC 67 ms
71,136 KB
testcase_03 AC 65 ms
71,028 KB
testcase_04 AC 66 ms
71,024 KB
testcase_05 AC 66 ms
71,072 KB
testcase_06 AC 160 ms
95,356 KB
testcase_07 AC 147 ms
95,360 KB
testcase_08 AC 150 ms
95,248 KB
testcase_09 AC 148 ms
95,548 KB
testcase_10 AC 1,582 ms
95,532 KB
testcase_11 AC 1,615 ms
95,740 KB
testcase_12 AC 148 ms
95,308 KB
testcase_13 AC 147 ms
95,552 KB
testcase_14 AC 1,710 ms
96,012 KB
testcase_15 AC 68 ms
70,840 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())
A=[]
for i in range(N):
  x,y=map(int, input().split())
  A.append((x,y,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:
      C=sorted(C,key=lambda x: x[1]) 
      C=sorted(C,key=lambda x: x[0]) 
      E[C[0][-1]]=1
      E[C[-1][-1]]=1
print(sum(E))
    
      
0