結果

問題 No.2355 Unhappy Back Dance
ユーザー hikikomorihikikomori
提出日時 2023-04-14 20:43:32
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1,709 ms / 6,000 ms
コード長 2,088 bytes
コンパイル時間 6,066 ms
コンパイル使用メモリ 339,088 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-18 19:16:06
合計ジャッジ時間 27,966 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 155 ms
6,940 KB
testcase_07 AC 161 ms
6,944 KB
testcase_08 AC 172 ms
6,944 KB
testcase_09 AC 173 ms
6,940 KB
testcase_10 AC 393 ms
6,944 KB
testcase_11 AC 421 ms
6,940 KB
testcase_12 AC 198 ms
6,944 KB
testcase_13 AC 196 ms
6,940 KB
testcase_14 AC 426 ms
6,940 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 AC 1,698 ms
6,940 KB
testcase_17 AC 1,704 ms
6,944 KB
testcase_18 AC 1,693 ms
6,944 KB
testcase_19 AC 1,709 ms
6,944 KB
testcase_20 AC 1,696 ms
6,940 KB
testcase_21 AC 703 ms
6,944 KB
testcase_22 AC 128 ms
6,944 KB
testcase_23 AC 134 ms
6,940 KB
testcase_24 AC 1,527 ms
6,940 KB
testcase_25 AC 820 ms
6,940 KB
testcase_26 AC 827 ms
6,940 KB
testcase_27 AC 705 ms
6,940 KB
testcase_28 AC 17 ms
6,940 KB
testcase_29 AC 37 ms
6,944 KB
testcase_30 AC 1,403 ms
6,940 KB
testcase_31 AC 1,004 ms
6,940 KB
testcase_32 AC 97 ms
6,940 KB
testcase_33 AC 566 ms
6,944 KB
testcase_34 AC 7 ms
6,944 KB
testcase_35 AC 18 ms
6,944 KB
testcase_36 AC 701 ms
6,940 KB
testcase_37 AC 369 ms
6,940 KB
testcase_38 AC 457 ms
6,944 KB
testcase_39 AC 355 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using Graph = vector<vector<ll>>;
using vi = vector<int>;
using vl = vector<long>;
using vll = vector<long long>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using vvll = vector<vll>;
using vs = vector<string>;
using vc = vector<char>;
using vvc = vector<vc>;
using pll = pair<long long, long long>;
using vpll = vector<pll>;
using mint = modint1000000007;
const long long INF = 1e18;
#define reps(i, a, n) for (ll i = (a); i < (ll)(n); i++)
#define rep(i, n) for (ll i = (0); i < (ll)(n); i++)
#define rrep(i, n) for (ll i = (1); i < (ll)(n + 1); i++)
#define repd(i, n) for (ll i = n - 1; i >= 0; i--)
#define rrepd(i, n) for (ll i = n; i >= 1; i--)
#define ALL(n) begin(n), end(n)
#define IN(a, x, b) (a <= x && x < b)
#define INIT                          \
    std::ios::sync_with_stdio(false); \
    std::cin.tie(0);
template <class T>
inline T CHMAX(T &a, const T b) {
    return a = (a < b) ? b : a;
}
template <class T>
inline T CHMIN(T &a, const T b) {
    return a = (a > b) ? b : a;
}
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
array<ll, 1510> X;
array<ll, 1510> Y;
int main() {
    INIT;
    ll N;
    cin >> N;

    rrep(i, N) { cin >> X[i] >> Y[i]; }
    set<ll> se;
    rrep(i, N) {
        set<pll> ma;
        rrep(j, N) {
            if (i != j) {
                pll ve = {X[j] - X[i], Y[j] - Y[i]};
                ll g = gcd(ve.first, ve.second);
                ve.first /= g;
                ve.second /= g;
                ma.insert(ve);
            }
        }
        rrep(j, N) {
            if (i != j) {
                pll ve = {X[j] - X[i], Y[j] - Y[i]};
                ll g = gcd(ve.first, ve.second);
                ve.first /= g;
                ve.second /= g;
                if (ma.count({-ve.first, -ve.second})) {
                    se.insert(j);
                }
            }
        }
    }
    cout << se.size() << endl;
}
0