結果

問題 No.1121 Social Distancing in Cinema
ユーザー IKyoproIKyopro
提出日時 2020-07-22 21:48:35
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 986 bytes
コンパイル時間 1,965 ms
コンパイル使用メモリ 204,936 KB
実行使用メモリ 5,720 KB
最終ジャッジ日時 2023-09-04 17:33:08
合計ジャッジ時間 7,526 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
5,184 KB
testcase_01 AC 3 ms
5,196 KB
testcase_02 AC 3 ms
5,172 KB
testcase_03 AC 3 ms
4,956 KB
testcase_04 AC 3 ms
5,096 KB
testcase_05 AC 3 ms
4,988 KB
testcase_06 AC 3 ms
5,148 KB
testcase_07 AC 3 ms
5,064 KB
testcase_08 AC 4 ms
5,132 KB
testcase_09 AC 3 ms
5,080 KB
testcase_10 AC 3 ms
5,100 KB
testcase_11 AC 3 ms
5,072 KB
testcase_12 AC 3 ms
5,132 KB
testcase_13 AC 3 ms
5,076 KB
testcase_14 AC 3 ms
5,288 KB
testcase_15 AC 4 ms
4,952 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 4 ms
4,972 KB
testcase_21 AC 4 ms
5,076 KB
testcase_22 AC 4 ms
4,948 KB
testcase_23 AC 4 ms
4,996 KB
testcase_24 AC 3 ms
4,972 KB
testcase_25 AC 15 ms
5,452 KB
testcase_26 AC 18 ms
5,340 KB
testcase_27 AC 5 ms
5,388 KB
testcase_28 AC 35 ms
5,456 KB
testcase_29 AC 17 ms
5,444 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 12 ms
5,416 KB
testcase_38 AC 16 ms
5,580 KB
testcase_39 WA -
testcase_40 AC 10 ms
5,372 KB
testcase_41 AC 5 ms
5,392 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 4 ms
5,104 KB
testcase_48 AC 3 ms
4,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int M = 500;
    vvec<int> id(M,vec<int>(M,-1));
    vvec<int> ok(M,vec<int>(M,1));
    int N;
    cin >> N;
    for(int i=0;i<N;i++){
        int x,y;
        cin >> x >> y;
        x--; y--;
        id[x][y] = i;
    }
    vec<int> ans;

    auto in = [&](int x,int y){
        return 0<=x && x<M && 0<=y && y<M;
    };

    auto update = [&](int x,int y){
        for(int dx=-10;dx<=10;dx++) for(int dy=-10;dy<=10;dy++){
            if(in(x+dx,y+dy) && dx*dx+dy*dy<=100) ok[x+dx][y+dy] = 0;
        }
    };

    for(int i=0;i<M;i++) for(int j=0;j<M;j++) if(id[i][j]!=-1 && ok[i][j]){
        ans.push_back(id[i][j]);
        update(i,j);
    }

    int n = ans.size();
    cout << n << "\n";
    for(int i=0;i<n;i++) cout << ans[i]+1 << (i!=n-1? " ":"\n");
}
0