結果

問題 No.1121 Social Distancing in Cinema
ユーザー catupper
提出日時 2020-07-22 22:16:23
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,292 bytes
コンパイル時間 1,212 ms
コンパイル使用メモリ 104,596 KB
実行使用メモリ 11,388 KB
最終ジャッジ日時 2024-06-22 18:43:16
合計ジャッジ時間 6,350 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 44 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include<complex>
using namespace std;
#define MOD 1000000007
#define MOD2 998244353
#define INF (1<<29)
#define LINF (1LL<<60)
#define EPS (1e-10)
#define PI 3.1415926535897932384626433832795028
typedef long long Int;
typedef pair<Int, Int> P;
typedef long double Real;
typedef complex<Real> CP;
typedef pair<P, Int> T;

Int n, x, y;
vector<T> points;
bool no[550][550];
vector<int> ans;
int main(){
    cin >> n;
    for(int i = 1;i <= n;i++){
        cin >> x >> y;
        points.push_back({{x,y}, i});
    }
    sort(points.begin(), points.end());
    for(auto p:points){
        x = p.first.first;
        y = p.first.second;
        int ind = p.second;
        if(no[x][y])continue;
        ans.push_back(ind);
        for(int i = -10;i <= 10;i++){
            for(int j = -10;j <= 10;j++){
                if(0 <= x+i && x+i < 550 && 0<= y + j && y + j < 550)
                    if(i*i+j*j< 10*10)
                        no[x+i][y+j] = true;
            }
        }
        
    }
    cout << ans.size() << endl;
    sort(ans.begin(), ans.end());
    for(auto ind:ans)cout << ind << " ";cout << endl;
    return 0;
}
0