結果
| 問題 | No.1121 Social Distancing in Cinema |
| コンテスト | |
| ユーザー |
IKyopro
|
| 提出日時 | 2020-07-22 21:48:35 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 986 bytes |
| 記録 | |
| コンパイル時間 | 2,119 ms |
| コンパイル使用メモリ | 199,000 KB |
| 最終ジャッジ日時 | 2025-01-12 02:33:24 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 WA * 17 |
ソースコード
#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");
}
IKyopro