結果

問題 No.2355 Unhappy Back Dance
ユーザー とりゐとりゐ
提出日時 2023-06-16 22:41:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,405 ms / 6,000 ms
コード長 402 bytes
コンパイル時間 406 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 81,012 KB
最終ジャッジ日時 2023-09-06 21:06:09
合計ジャッジ時間 21,650 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
71,524 KB
testcase_01 AC 64 ms
71,188 KB
testcase_02 AC 64 ms
71,296 KB
testcase_03 AC 63 ms
71,276 KB
testcase_04 AC 67 ms
71,316 KB
testcase_05 AC 61 ms
71,608 KB
testcase_06 AC 258 ms
77,544 KB
testcase_07 AC 328 ms
78,036 KB
testcase_08 AC 340 ms
78,056 KB
testcase_09 AC 294 ms
78,000 KB
testcase_10 AC 433 ms
78,552 KB
testcase_11 AC 440 ms
79,056 KB
testcase_12 AC 302 ms
77,772 KB
testcase_13 AC 296 ms
77,868 KB
testcase_14 AC 410 ms
78,896 KB
testcase_15 AC 61 ms
71,108 KB
testcase_16 AC 1,362 ms
80,852 KB
testcase_17 AC 1,405 ms
81,012 KB
testcase_18 AC 1,379 ms
80,780 KB
testcase_19 AC 1,362 ms
80,692 KB
testcase_20 AC 1,379 ms
80,808 KB
testcase_21 AC 619 ms
78,092 KB
testcase_22 AC 187 ms
77,676 KB
testcase_23 AC 194 ms
77,524 KB
testcase_24 AC 1,278 ms
80,436 KB
testcase_25 AC 720 ms
78,460 KB
testcase_26 AC 715 ms
78,412 KB
testcase_27 AC 630 ms
78,012 KB
testcase_28 AC 89 ms
76,604 KB
testcase_29 AC 111 ms
77,456 KB
testcase_30 AC 1,149 ms
79,916 KB
testcase_31 AC 884 ms
79,228 KB
testcase_32 AC 158 ms
77,524 KB
testcase_33 AC 531 ms
77,884 KB
testcase_34 AC 95 ms
76,564 KB
testcase_35 AC 106 ms
76,460 KB
testcase_36 AC 639 ms
78,000 KB
testcase_37 AC 382 ms
77,752 KB
testcase_38 AC 447 ms
77,684 KB
testcase_39 AC 368 ms
77,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
xy=[]
for i in range(n):
  x,y=map(int,input().split())
  xy.append((x,y))

ans=0
import math
for i in range(n):
  s=set()
  flag=False
  for j in range(n):
    if i==j:
      continue
    xi,yi=xy[i]
    xj,yj=xy[j]
    dx=xj-xi
    dy=yj-yi
    g=math.gcd(dx,dy)
    dx//=g
    dy//=g
    if (dx,dy) in s:
      flag=True
    else:
      s.add((dx,dy))
  if flag:
    ans+=1
print(ans)
0