結果

問題 No.2355 Unhappy Back Dance
ユーザー hourenhouren
提出日時 2023-06-16 23:01:02
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,624 ms / 6,000 ms
コード長 1,025 bytes
コンパイル時間 1,509 ms
コンパイル使用メモリ 173,744 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-06 21:46:51
合計ジャッジ時間 20,794 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,384 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 136 ms
4,384 KB
testcase_11 AC 132 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 129 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1,607 ms
4,380 KB
testcase_17 AC 1,621 ms
4,380 KB
testcase_18 AC 1,624 ms
4,380 KB
testcase_19 AC 1,602 ms
4,380 KB
testcase_20 AC 1,614 ms
4,380 KB
testcase_21 AC 680 ms
4,380 KB
testcase_22 AC 115 ms
4,380 KB
testcase_23 AC 123 ms
4,380 KB
testcase_24 AC 1,421 ms
4,380 KB
testcase_25 AC 770 ms
4,376 KB
testcase_26 AC 771 ms
4,376 KB
testcase_27 AC 644 ms
4,380 KB
testcase_28 AC 14 ms
4,380 KB
testcase_29 AC 35 ms
4,380 KB
testcase_30 AC 1,314 ms
4,376 KB
testcase_31 AC 959 ms
4,380 KB
testcase_32 AC 91 ms
4,384 KB
testcase_33 AC 537 ms
4,380 KB
testcase_34 AC 6 ms
4,384 KB
testcase_35 AC 16 ms
4,380 KB
testcase_36 AC 653 ms
4,376 KB
testcase_37 AC 369 ms
4,380 KB
testcase_38 AC 453 ms
4,376 KB
testcase_39 AC 347 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define fix(x) fixed << setprecision(x)
#define asc(x) x, vector<x>, greater<x>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
template<class T>bool chmin(T&a, const T&b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool chmax(T&a, const T&b){if(a<b){a=b;return 1;}return 0;}
constexpr ll INFLL = (1LL << 62), MOD = 998244353;
constexpr int INF = (1 << 30);

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<ll> x(n), y(n);
    rep(i,n) cin >> x[i] >> y[i];
    int ans = 0;
    rep(i,n){
        set<pair<ll,ll>> se;
        rep(j,n){
            if(j==i) continue;
            ll p = x[j]-x[i], q = y[j]-y[i], g = abs(__gcd(p,q));
            p /= g, q /= g;
            if(se.count({p,q})){
                ans++;
                break;
            }
            se.insert({p,q});
        }
    }
    cout << ans << '\n';
    return 0;
}
0