結果

問題 No.2355 Unhappy Back Dance
ユーザー ぷらぷら
提出日時 2023-06-16 22:00:05
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,697 ms / 6,000 ms
コード長 738 bytes
コンパイル時間 2,106 ms
コンパイル使用メモリ 207,800 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-06 19:46:50
合計ジャッジ時間 23,860 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 82 ms
4,380 KB
testcase_07 AC 62 ms
4,380 KB
testcase_08 AC 83 ms
4,380 KB
testcase_09 AC 83 ms
4,376 KB
testcase_10 AC 305 ms
4,380 KB
testcase_11 AC 302 ms
4,376 KB
testcase_12 AC 85 ms
4,380 KB
testcase_13 AC 87 ms
4,380 KB
testcase_14 AC 317 ms
4,380 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 1,688 ms
4,380 KB
testcase_17 AC 1,692 ms
4,380 KB
testcase_18 AC 1,697 ms
4,376 KB
testcase_19 AC 1,692 ms
4,380 KB
testcase_20 AC 1,697 ms
4,380 KB
testcase_21 AC 699 ms
4,500 KB
testcase_22 AC 126 ms
4,376 KB
testcase_23 AC 136 ms
4,380 KB
testcase_24 AC 1,511 ms
4,376 KB
testcase_25 AC 804 ms
4,376 KB
testcase_26 AC 819 ms
4,380 KB
testcase_27 AC 705 ms
4,380 KB
testcase_28 AC 16 ms
4,376 KB
testcase_29 AC 37 ms
4,380 KB
testcase_30 AC 1,392 ms
4,376 KB
testcase_31 AC 1,008 ms
4,380 KB
testcase_32 AC 98 ms
4,376 KB
testcase_33 AC 570 ms
4,376 KB
testcase_34 AC 6 ms
4,376 KB
testcase_35 AC 17 ms
4,376 KB
testcase_36 AC 700 ms
4,380 KB
testcase_37 AC 372 ms
4,376 KB
testcase_38 AC 462 ms
4,376 KB
testcase_39 AC 359 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    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(i == j) continue;
            long long x = X[i]-X[j],y = Y[i]-Y[j];
            long long g = __gcd(abs(x),abs(y));
            x /= g;
            y /= g;
            mp[{x,y}]++;
        }
        for(auto i:mp) {
            if(i.second >= 2) {
                ans++;
                break;
            }
        }
    }
    cout << ans << "\n";
}
0