結果

問題 No.202 1円玉投げ
ユーザー 古寺いろは古寺いろは
提出日時 2015-05-08 12:06:51
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,139 bytes
コンパイル時間 1,356 ms
コンパイル使用メモリ 151,520 KB
実行使用メモリ 9,636 KB
最終ジャッジ日時 2023-08-23 22:33:46
合計ジャッジ時間 33,232 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 558 ms
9,472 KB
testcase_01 AC 2,634 ms
9,424 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 63 ms
4,380 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1,220 ms
6,176 KB
testcase_10 AC 422 ms
4,624 KB
testcase_11 AC 971 ms
5,740 KB
testcase_12 AC 995 ms
5,640 KB
testcase_13 AC 480 ms
4,728 KB
testcase_14 AC 80 ms
4,376 KB
testcase_15 WA -
testcase_16 AC 711 ms
9,344 KB
testcase_17 AC 1,876 ms
9,468 KB
testcase_18 AC 1,870 ms
9,636 KB
testcase_19 AC 1,085 ms
5,936 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 5 ms
4,376 KB
testcase_23 AC 5 ms
4,376 KB
testcase_24 AC 5 ms
4,376 KB
testcase_25 AC 6 ms
4,376 KB
testcase_26 AC 5 ms
4,380 KB
testcase_27 AC 5 ms
4,376 KB
testcase_28 AC 5 ms
4,380 KB
testcase_29 AC 6 ms
4,376 KB
testcase_30 AC 5 ms
4,380 KB
testcase_31 AC 3 ms
4,376 KB
testcase_32 AC 6 ms
4,380 KB
testcase_33 AC 11 ms
4,380 KB
testcase_34 AC 8 ms
4,380 KB
testcase_35 AC 1,153 ms
9,436 KB
testcase_36 AC 1,126 ms
9,320 KB
testcase_37 WA -
testcase_38 AC 1,159 ms
9,496 KB
testcase_39 AC 4 ms
4,376 KB
testcase_40 AC 3 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int sy[20130];
int sx[20130];

int main() {
    int N;
    cin >> N;
    vector<long long> x(N), y(N);

    for (int i = 0; i < 20130; i++)
    {
        sy[i] = 100030;
        sx[i] = 100030;
    }

    for (int i = 0; i < N; i++)
    {
        cin >> x[i] >> y[i];
	x[i] += 50;
	y[i] += 50;
        sy[y[i]] = min(sy[y[i]], i + 1);
        sx[x[i]] = min(sx[x[i]], i + 1);
    }

    int ans = 0;
    set<long long> s;

    for (int i = 0; i < N; i++)
    {
        bool flag = true;
        for (int dy = -20; dy <= 20 && flag; dy++)
        {
            for (int dx = -20; dx <= 20 && flag; dx++)
            {
                if (dy*dy + dx*dx >= 400) continue;
                long long Y = y[i] + dy;
                long long X = x[i] + dx;
                if (sy[Y] >= i + 1 && sx[X] >= i + 1) continue;
                if (s.count(Y * 20001 + X)){
                    flag = false;
                    break;
                }
            }
        }
        if (flag){
            ans++;
            s.insert(y[i] * 20001 + x[i]);
        }
    }
    cout << ans << endl;
    
} 
0