結果

問題 No.202 1円玉投げ
ユーザー 🍮かんプリン🍮かんプリン
提出日時 2020-05-22 23:28:32
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 746 ms / 5,000 ms
コード長 875 bytes
コンパイル時間 1,235 ms
コンパイル使用メモリ 151,240 KB
実行使用メモリ 53,224 KB
最終ジャッジ日時 2023-08-24 00:13:14
合計ジャッジ時間 13,745 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 412 ms
52,944 KB
testcase_01 AC 746 ms
53,072 KB
testcase_02 AC 37 ms
53,000 KB
testcase_03 AC 38 ms
53,224 KB
testcase_04 AC 38 ms
53,024 KB
testcase_05 AC 82 ms
53,008 KB
testcase_06 AC 592 ms
52,916 KB
testcase_07 AC 648 ms
53,024 KB
testcase_08 AC 667 ms
52,876 KB
testcase_09 AC 404 ms
53,076 KB
testcase_10 AC 195 ms
53,060 KB
testcase_11 AC 341 ms
53,192 KB
testcase_12 AC 349 ms
53,056 KB
testcase_13 AC 211 ms
52,864 KB
testcase_14 AC 89 ms
52,912 KB
testcase_15 AC 388 ms
52,944 KB
testcase_16 AC 363 ms
52,924 KB
testcase_17 AC 391 ms
52,988 KB
testcase_18 AC 392 ms
52,920 KB
testcase_19 AC 374 ms
52,940 KB
testcase_20 AC 538 ms
52,940 KB
testcase_21 AC 364 ms
52,916 KB
testcase_22 AC 43 ms
53,224 KB
testcase_23 AC 43 ms
53,080 KB
testcase_24 AC 39 ms
52,948 KB
testcase_25 AC 39 ms
52,920 KB
testcase_26 AC 41 ms
52,920 KB
testcase_27 AC 41 ms
52,932 KB
testcase_28 AC 40 ms
52,868 KB
testcase_29 AC 40 ms
52,944 KB
testcase_30 AC 44 ms
52,996 KB
testcase_31 AC 39 ms
52,916 KB
testcase_32 AC 47 ms
53,076 KB
testcase_33 AC 41 ms
52,916 KB
testcase_34 AC 43 ms
53,020 KB
testcase_35 AC 372 ms
52,880 KB
testcase_36 AC 460 ms
52,868 KB
testcase_37 AC 688 ms
53,060 KB
testcase_38 AC 379 ms
52,992 KB
testcase_39 AC 41 ms
52,912 KB
testcase_40 AC 40 ms
52,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
 *   @FileName	a.cpp
 *   @Author	kanpurin
 *   @Created	2020.05.22 23:28:25
**/

#include "bits/stdc++.h" 
using namespace std; 
typedef long long ll;

int main() {
    int n;cin >> n;
    vector<vector<bool>> g(20001,vector<bool>(20001,false));
    int ans = 0;
    vector<int> dx,dy;
    for (int i = -20; i <= 20; i++) {
        for (int j = -20; j <= 20; j++) {
            if (i * i + j * j < 400) {
                dx.push_back(i);
                dy.push_back(j);
            }
        }
    }
    for (int i = 0; i < n; i++) {
        int a,b;cin >> a >> b;
        if (g[a][b]) continue;
        for (int k = 0; k < dx.size(); k++) {
            int x = a + dx[k], y = b + dy[k];
            if (x >= 0 && x <= 20000 && y >= 0 && y <= 20000) {
                g[x][y] = true;
            }
        }
        ans++;
    }
    cout << ans << endl;
    return 0;
}
0