結果
問題 |
No.1121 Social Distancing in Cinema
|
ユーザー |
![]() |
提出日時 | 2020-07-22 21:51:43 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 985 bytes |
コンパイル時間 | 2,246 ms |
コンパイル使用メモリ | 198,824 KB |
最終ジャッジ日時 | 2025-01-12 02:35:18 |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 44 WA * 3 |
ソースコード
#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"); }