結果
| 問題 |
No.1121 Social Distancing in Cinema
|
| コンテスト | |
| ユーザー |
divinediscon10t
|
| 提出日時 | 2020-07-22 22:22:16 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,287 bytes |
| コンパイル時間 | 2,016 ms |
| コンパイル使用メモリ | 179,432 KB |
| 実行使用メモリ | 25,208 KB |
| 最終ジャッジ日時 | 2024-06-22 18:53:36 |
| 合計ジャッジ時間 | 7,797 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 32 WA * 15 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(int i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;
int main(){
cin.tie(0); ios::sync_with_stdio(false);
ll n; cin >> n;
ll x[n], y[n]; zep(i, 0, n)cin >> x[i] >> y[i];
vector<vector<ll>> v(n);
zep(i, 0, n)v[i] = {x[i] + y[i], x[i], y[i], i + 1};
sort(v.begin(), v.end());
bool use[555][555]; memset(use, 0, sizeof(use));
vector<ll> ans;
zep(i, 0, n){
ll vx = v[i][1], vy = v[i][2];
if(!use[vx][vy]){
use[vx][vy] = true;
ans.push_back(v[i][3]);
rep(j, -10, 10){
rep(k, -10, 10){
if(j * j + k * k < 100){
if(1 <= vx + j && vx + j <= 500 && 1 <= vy + k && vy + k <= 500){
use[vx + j][vy + k] = true;
//cout << j << " " << k << endl;
}
}
}
}
}
}
print(ans.size())
zep(i, 0, ans.size())cout << ans[i] << " "; cout << endl;
return 0;
}
divinediscon10t