結果

問題 No.2355 Unhappy Back Dance
ユーザー chankei271828chankei271828
提出日時 2023-06-16 22:54:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,478 ms / 6,000 ms
コード長 476 bytes
コンパイル時間 398 ms
コンパイル使用メモリ 86,972 KB
実行使用メモリ 82,516 KB
最終ジャッジ日時 2023-09-06 21:33:04
合計ジャッジ時間 20,515 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
71,388 KB
testcase_01 AC 62 ms
71,380 KB
testcase_02 AC 60 ms
71,552 KB
testcase_03 AC 61 ms
71,344 KB
testcase_04 AC 63 ms
71,336 KB
testcase_05 AC 60 ms
71,336 KB
testcase_06 AC 89 ms
77,100 KB
testcase_07 AC 93 ms
78,048 KB
testcase_08 AC 92 ms
78,068 KB
testcase_09 AC 93 ms
78,080 KB
testcase_10 AC 219 ms
78,276 KB
testcase_11 AC 221 ms
78,384 KB
testcase_12 AC 101 ms
77,680 KB
testcase_13 AC 100 ms
78,220 KB
testcase_14 AC 213 ms
78,380 KB
testcase_15 AC 63 ms
71,636 KB
testcase_16 AC 1,445 ms
82,044 KB
testcase_17 AC 1,478 ms
82,516 KB
testcase_18 AC 1,439 ms
82,316 KB
testcase_19 AC 1,436 ms
82,428 KB
testcase_20 AC 1,435 ms
82,204 KB
testcase_21 AC 657 ms
78,500 KB
testcase_22 AC 190 ms
77,480 KB
testcase_23 AC 199 ms
77,440 KB
testcase_24 AC 1,463 ms
82,016 KB
testcase_25 AC 745 ms
79,196 KB
testcase_26 AC 732 ms
79,124 KB
testcase_27 AC 648 ms
78,280 KB
testcase_28 AC 90 ms
76,612 KB
testcase_29 AC 110 ms
77,260 KB
testcase_30 AC 1,214 ms
81,120 KB
testcase_31 AC 891 ms
79,572 KB
testcase_32 AC 166 ms
77,280 KB
testcase_33 AC 550 ms
78,116 KB
testcase_34 AC 83 ms
76,488 KB
testcase_35 AC 92 ms
76,368 KB
testcase_36 AC 669 ms
78,252 KB
testcase_37 AC 398 ms
77,828 KB
testcase_38 AC 467 ms
77,792 KB
testcase_39 AC 398 ms
77,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
N=int(input())
p=[tuple(map(int,input().split())) for _ in range(N)]
cnt=0
for i in range(N):
    d={}
    a_x,a_y=p[i]
    for j in range(N):
        if i==j:
            continue
        d_x,d_y=p[j][0]-a_x,p[j][1]-a_y
        if d_x==0:
            d_y//=abs(d_y)
        else:
            v=math.gcd(d_x,d_y)
            d_x,d_y=d_x//v,d_y//v
        if (d_x,d_y) in d:
            cnt+=1
            break
        d[(d_x,d_y)]=1
    #print(i,d,cnt)
print(cnt)
0