結果

問題 No.2355 Unhappy Back Dance
ユーザー SSRSSSRS
提出日時 2023-06-16 21:46:44
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 939 ms / 6,000 ms
コード長 597 bytes
コンパイル時間 2,565 ms
コンパイル使用メモリ 208,504 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-06 19:15:08
合計ジャッジ時間 15,511 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 59 ms
4,380 KB
testcase_07 AC 59 ms
4,376 KB
testcase_08 AC 66 ms
4,380 KB
testcase_09 AC 67 ms
4,376 KB
testcase_10 AC 225 ms
4,380 KB
testcase_11 AC 222 ms
4,376 KB
testcase_12 AC 68 ms
4,380 KB
testcase_13 AC 68 ms
4,380 KB
testcase_14 AC 236 ms
4,376 KB
testcase_15 AC 1 ms
4,384 KB
testcase_16 AC 931 ms
4,380 KB
testcase_17 AC 936 ms
4,376 KB
testcase_18 AC 939 ms
4,380 KB
testcase_19 AC 933 ms
4,376 KB
testcase_20 AC 933 ms
4,376 KB
testcase_21 AC 400 ms
4,380 KB
testcase_22 AC 72 ms
4,376 KB
testcase_23 AC 78 ms
4,380 KB
testcase_24 AC 863 ms
4,376 KB
testcase_25 AC 447 ms
4,380 KB
testcase_26 AC 471 ms
4,380 KB
testcase_27 AC 400 ms
4,384 KB
testcase_28 AC 9 ms
4,380 KB
testcase_29 AC 21 ms
4,380 KB
testcase_30 AC 778 ms
4,380 KB
testcase_31 AC 564 ms
4,380 KB
testcase_32 AC 53 ms
4,380 KB
testcase_33 AC 312 ms
4,380 KB
testcase_34 AC 4 ms
4,380 KB
testcase_35 AC 10 ms
4,380 KB
testcase_36 AC 385 ms
4,380 KB
testcase_37 AC 222 ms
4,376 KB
testcase_38 AC 247 ms
4,380 KB
testcase_39 AC 201 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  vector<long long> X(N), Y(N);
  for (int i = 0; i < N; i++){
    cin >> X[i] >> Y[i];
  }
  int ans = 0;
  for (int i = 0; i < N; i++){
    map<pair<long long, long long>, int> mp;
    for (int j = 0; j < N; j++){
      if (j != i){
        long long dx = X[j] - X[i];
        long long dy = Y[j] - Y[i];
        long long g = gcd(dx, dy);
        mp[make_pair(dx / g, dy / g)]++;
      }
    }
    for (auto P : mp){
      if (P.second >= 2){
        ans++;
        break;
      }
    }
  }
  cout << ans << endl;
}
0