結果

問題 No.202 1円玉投げ
ユーザー commycommy
提出日時 2021-03-22 01:06:22
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,015 bytes
コンパイル時間 644 ms
コンパイル使用メモリ 77,028 KB
実行使用メモリ 394,716 KB
最終ジャッジ日時 2023-08-24 00:21:21
合計ジャッジ時間 11,493 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 267 ms
159,780 KB
testcase_01 AC 422 ms
394,512 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
5,560 KB
testcase_05 AC 291 ms
372,440 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 291 ms
379,984 KB
testcase_15 WA -
testcase_16 AC 302 ms
265,728 KB
testcase_17 AC 237 ms
58,720 KB
testcase_18 AC 236 ms
58,784 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 73 ms
238,312 KB
testcase_23 AC 73 ms
238,620 KB
testcase_24 AC 6 ms
22,200 KB
testcase_25 AC 5 ms
22,208 KB
testcase_26 AC 3 ms
4,380 KB
testcase_27 AC 4 ms
4,380 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 67 ms
230,716 KB
testcase_31 AC 1 ms
4,376 KB
testcase_32 AC 117 ms
216,684 KB
testcase_33 WA -
testcase_34 AC 7 ms
12,108 KB
testcase_35 AC 233 ms
44,316 KB
testcase_36 AC 289 ms
258,192 KB
testcase_37 WA -
testcase_38 AC 234 ms
43,876 KB
testcase_39 AC 20 ms
61,768 KB
testcase_40 AC 15 ms
35,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <iostream>
#include <numeric>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
using ll = long long int;
using P = pair<ll, ll>;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; debug_print(__VA_ARGS__); } while(false)
template<typename T, typename... Ts> void debug_print(const T &t, const Ts &...ts) { cerr << t; ((cerr << ", " << ts), ...); cerr << endl; }
#else
#define dump(...) do{ } while(false)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T> bool chmin(T &a, const T& b) { if (a > b) {a = b; return true; } return false; }
template<typename T> bool chmax(T &a, const T& b) { if (a < b) {a = b; return true; } return false; }
template<typename T, typename... Ts> void print(const T& t, const Ts&... ts) { cout << t; ((cout << ' ' << ts), ...); cout << '\n'; }
template<typename... Ts> void input(Ts&... ts) { (cin >> ... >> ts); }
template<typename T> istream &operator,(istream &in, T &t) { return in >> t; }
// clang-format on

constexpr int sz = 20010;

bool ng[sz][sz];

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    input(n);
    constexpr int radius = 10;
    int ans = 0;
    rep(i, 0, n) {
        int x, y;
        input(x, y);
        if (!ng[x][y]) {
            ans += !ng[x][y];
            rep(dx, x - 2 * radius, x + 2 * radius + 1) {
                if (dx < 0 || dx >= sz) continue;
                rep(dy, y - 2 * radius, y + 2 * radius + 1) {
                    if (dy < 0 || dy >= sz) continue;
                    ng[dx][dy] = (dx - x) * (dx - x) + (dy - y) * (dy - y) < 4 * radius * radius;
                }
            }
        }
    }
    print(ans);

    return 0;
}
0