結果

問題 No.202 1円玉投げ
ユーザー BantakoBantako
提出日時 2018-05-31 19:28:05
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 681 ms / 5,000 ms
コード長 1,029 bytes
コンパイル時間 1,597 ms
コンパイル使用メモリ 173,408 KB
実行使用メモリ 9,684 KB
最終ジャッジ日時 2023-08-23 23:51:37
合計ジャッジ時間 10,989 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 296 ms
9,356 KB
testcase_01 AC 681 ms
9,368 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 14 ms
4,376 KB
testcase_06 AC 516 ms
8,144 KB
testcase_07 AC 609 ms
8,724 KB
testcase_08 AC 606 ms
8,572 KB
testcase_09 AC 267 ms
6,808 KB
testcase_10 AC 80 ms
5,296 KB
testcase_11 AC 207 ms
6,156 KB
testcase_12 AC 212 ms
6,288 KB
testcase_13 AC 91 ms
5,232 KB
testcase_14 AC 18 ms
4,384 KB
testcase_15 AC 251 ms
6,432 KB
testcase_16 AC 161 ms
9,316 KB
testcase_17 AC 352 ms
9,464 KB
testcase_18 AC 341 ms
9,684 KB
testcase_19 AC 234 ms
6,408 KB
testcase_20 AC 451 ms
7,804 KB
testcase_21 AC 238 ms
6,476 KB
testcase_22 AC 3 ms
4,380 KB
testcase_23 AC 4 ms
4,384 KB
testcase_24 AC 3 ms
4,384 KB
testcase_25 AC 3 ms
4,380 KB
testcase_26 AC 4 ms
4,376 KB
testcase_27 AC 4 ms
4,384 KB
testcase_28 AC 3 ms
4,380 KB
testcase_29 AC 3 ms
4,384 KB
testcase_30 AC 4 ms
4,380 KB
testcase_31 AC 3 ms
4,380 KB
testcase_32 AC 4 ms
4,376 KB
testcase_33 AC 4 ms
4,384 KB
testcase_34 AC 5 ms
4,376 KB
testcase_35 AC 300 ms
9,320 KB
testcase_36 AC 273 ms
9,324 KB
testcase_37 AC 678 ms
8,816 KB
testcase_38 AC 302 ms
9,392 KB
testcase_39 AC 3 ms
4,376 KB
testcase_40 AC 3 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:8:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    8 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int N;
    cin >> N;
    vector< P > V(N);
    vector<set<int> > X(20010);
    rep(i,N){
        int a,b;
        cin >> a >> b;
        V[i] = P(a,b);
    }
    int cnt = 0;
    rep(i,N){
        auto p = V[i];
        int x = p.first, y = p.second;
        bool ok = 1;
        //(x,y)との距離の2乗が400未満となる点を探す
        for(int j = max(0,x-20);j <= x+20;j++){
            for(int k = max(0,y-20);k <= y+20;k++){
                ll r = (x - j) * (x - j) + (y - k) * (y - k);
                //cout << j << " " << k << endl;
                if(X[j].count(k) && r < 400){
                    ok = 0;
                    j = x+20;
                    break;
                }
            }
        }
        if(ok){
            X[x].insert(y);
            cnt++;
        }
    }
    cout << cnt << endl;
}
0