結果
問題 | No.2355 Unhappy Back Dance |
ユーザー |
![]() |
提出日時 | 2025-03-20 18:56:57 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,447 ms / 6,000 ms |
コード長 | 1,060 bytes |
コンパイル時間 | 163 ms |
コンパイル使用メモリ | 82,536 KB |
実行使用メモリ | 82,600 KB |
最終ジャッジ日時 | 2025-03-20 18:58:25 |
合計ジャッジ時間 | 22,206 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 37 |
ソースコード
import sysimport mathdef main():input = sys.stdin.read().split()idx = 0N = int(input[idx])idx += 1points = []for _ in range(N):x = int(input[idx])y = int(input[idx+1])points.append((x, y))idx += 2result = 0for i in range(N):xi, yi = points[i]dir_counts = {}for j in range(N):if i == j:continuexj, yj = points[j]dx = xj - xidy = yj - yig = math.gcd(abs(dx), abs(dy))if g == 0:continue # Not possible as per problem constraintsreduced = (dx // g, dy // g)if reduced in dir_counts:dir_counts[reduced] += 1else:dir_counts[reduced] = 1# Check if any direction has at least two pointsfor count in dir_counts.values():if count >= 2:result += 1breakprint(result)if __name__ == '__main__':main()