結果

問題 No.2355 Unhappy Back Dance
ユーザー matsup10matsup10
提出日時 2023-06-16 22:44:52
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,012 ms / 6,000 ms
コード長 1,011 bytes
コンパイル時間 5,561 ms
コンパイル使用メモリ 322,612 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-06 21:16:30
合計ジャッジ時間 18,432 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 66 ms
4,376 KB
testcase_07 AC 67 ms
4,376 KB
testcase_08 AC 68 ms
4,376 KB
testcase_09 AC 69 ms
4,380 KB
testcase_10 AC 254 ms
4,376 KB
testcase_11 AC 247 ms
4,380 KB
testcase_12 AC 71 ms
4,380 KB
testcase_13 AC 70 ms
4,376 KB
testcase_14 AC 277 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 981 ms
4,376 KB
testcase_17 AC 990 ms
4,380 KB
testcase_18 AC 997 ms
4,376 KB
testcase_19 AC 1,012 ms
4,380 KB
testcase_20 AC 994 ms
4,380 KB
testcase_21 AC 404 ms
4,376 KB
testcase_22 AC 73 ms
4,380 KB
testcase_23 AC 82 ms
4,380 KB
testcase_24 AC 911 ms
4,380 KB
testcase_25 AC 470 ms
4,376 KB
testcase_26 AC 530 ms
4,376 KB
testcase_27 AC 463 ms
4,380 KB
testcase_28 AC 10 ms
4,380 KB
testcase_29 AC 23 ms
4,376 KB
testcase_30 AC 824 ms
4,376 KB
testcase_31 AC 597 ms
4,380 KB
testcase_32 AC 58 ms
4,380 KB
testcase_33 AC 326 ms
4,380 KB
testcase_34 AC 4 ms
4,376 KB
testcase_35 AC 11 ms
4,376 KB
testcase_36 AC 405 ms
4,376 KB
testcase_37 AC 223 ms
4,384 KB
testcase_38 AC 277 ms
4,376 KB
testcase_39 AC 214 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/extc++.h>
#include <atcoder/all>

using namespace std;
using ll = long long;
#define REP(i,n) for(int i=0;i<int(n);i++)
#define FOR(i,a,b) for(int i=a;i<=int(b);i++)
#define ALL(x) x.begin(),x.end()
#define INF INT_MAX
#define INFL LLONG_MAX / 4
using namespace atcoder;
using mint = modint998244353;
template<typename T> void chmin(T& a, T b) { a = min(a, b); }
template<typename T> void chmax(T& a, T b) { a = max(a, b); }
#define PR(x) cerr << #x << "=" << x << endl
using i128 = __int128_t;

int main() {
  int n;
  cin >> n;
  vector<ll> x(n), y(n);
  REP(i, n) cin >> x[i] >> y[i];

  int ans = 0;
  REP(i, n) {
    map<pair<ll, ll>, int> mp;
    bool ok = false;
    REP(j, n) {
      if(i == j) continue;
      ll dx = x[j] - x[i];
      ll dy = y[j] - y[i];
      if(dx == 0) dy = dy;
      if(dy == 0) dx = dx;
      ll g = gcd(abs(dx), abs(dy));
      dy /= g; dx /= g;
      mp[{dx,dy}] ++;
      if(mp[{dx,dy}] >= 2) ok =true;
    }
    if(ok) ans++;
  }
  cout << ans;
  return 0;
}
0