結果

問題 No.2355 Unhappy Back Dance
ユーザー FplusFplusFFplusFplusF
提出日時 2023-06-17 06:08:03
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,103 ms / 6,000 ms
コード長 907 bytes
コンパイル時間 4,973 ms
コンパイル使用メモリ 207,740 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-07 04:22:43
合計ジャッジ時間 18,362 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 70 ms
4,380 KB
testcase_07 AC 70 ms
4,380 KB
testcase_08 AC 73 ms
4,384 KB
testcase_09 AC 72 ms
4,380 KB
testcase_10 AC 276 ms
4,380 KB
testcase_11 AC 269 ms
4,380 KB
testcase_12 AC 77 ms
4,380 KB
testcase_13 AC 77 ms
4,384 KB
testcase_14 AC 289 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1,074 ms
4,380 KB
testcase_17 AC 1,070 ms
4,376 KB
testcase_18 AC 1,075 ms
4,384 KB
testcase_19 AC 1,103 ms
4,376 KB
testcase_20 AC 1,069 ms
4,380 KB
testcase_21 AC 435 ms
4,376 KB
testcase_22 AC 78 ms
4,380 KB
testcase_23 AC 83 ms
4,380 KB
testcase_24 AC 963 ms
4,376 KB
testcase_25 AC 509 ms
4,380 KB
testcase_26 AC 514 ms
4,384 KB
testcase_27 AC 442 ms
4,380 KB
testcase_28 AC 10 ms
4,380 KB
testcase_29 AC 23 ms
4,376 KB
testcase_30 AC 878 ms
4,376 KB
testcase_31 AC 637 ms
4,376 KB
testcase_32 AC 62 ms
4,376 KB
testcase_33 AC 357 ms
4,380 KB
testcase_34 AC 4 ms
4,376 KB
testcase_35 AC 11 ms
4,376 KB
testcase_36 AC 443 ms
4,376 KB
testcase_37 AC 231 ms
4,384 KB
testcase_38 AC 286 ms
4,380 KB
testcase_39 AC 225 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll,ll>;
using ld=long double;
const ll INF=(1ll<<60);
#define rep(i,n) for (ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(),v.end()
template<class T> void chmin(T &a,T b){
    if(a>b){
        a=b;
    }
}
template<class T> void chmax(T &a,T b){
    if(a<b){
        a=b;
    }
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n;
    cin >> n;
    vector<ll> x(n),y(n);
    rep(i,n) cin >> x[i] >> y[i];
    ll ans=0;
    rep(i,n){
        bool ok=false;
        set<pll> st;
        rep(j,n){
            if(i==j) continue;
            ll dx=x[i]-x[j],dy=y[i]-y[j];
            ll g=gcd(dx,dy);
            dx/=g;
            dy/=g;
            if(st.count({dx,dy})) ok=true;
            st.insert({dx,dy});
        }
        if(ok) ans++;
    }
    cout << ans << '\n';
}
0