結果

問題 No.1121 Social Distancing in Cinema
ユーザー IlagIlag
提出日時 2020-07-22 23:51:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,404 bytes
コンパイル時間 1,766 ms
コンパイル使用メモリ 172,104 KB
実行使用メモリ 8,776 KB
最終ジャッジ日時 2023-09-05 05:37:16
合計ジャッジ時間 7,310 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
8,760 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
testcase_48 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const long long INF = 1001001001;
const long long MOD = 1000000007;
const double EPS = 1e-10;

P cmp[505][505];
P rev[505][505];

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll n;
    cin>>n;
    int x[n],y[n];
    P xy[n];
    P p1[n],p2[n];
    for(int i=0;i<n;i++){
        cin>>x[i]>>y[i];
        xy[i]=P(x[i],y[i]);
        p1[i]=P(x[i],y[i]);
        p2[i]=P(y[i],x[i]);
    }
    sort(p1,p1+n);
    sort(p2,p2+n);
    int maxx=0,maxy=0;
    for(int i=0,prex=-1,curv=-1;i<n;i++){
        if(prex!=p1[i].first)curv++;
        cmp[p1[i].first][p1[i].second].first=curv;
        maxx=max(maxx,curv);
        prex=p1[i].first;
    }
    for(int i=0,prey=-1,curv=-1;i<n;i++){
        if(prey!=p2[i].first)curv++;
        cmp[p2[i].second][p2[i].first].second=curv;
        maxy=max(maxy,curv);
        prey=p2[i].first;
    }
    for(int i=0;i<n;i++){
        rev[cmp[x[i]][y[i]].first][cmp[x[i]][y[i]].second]=P(x[i],y[i]);
    }
    vector<P> vec;
    for(int i=0;i<=maxx;i+=10){
        for(int j=0;j<=maxy;j+=10){
            vec.emplace_back(rev[cmp[j][i].first][cmp[j][i].second]);
        }
    }
    if(vec.size()<n/90){
        for(;;);
    }
    cout<<vec.size()<<endl;
    for(auto aeiou:vec){
        int idx=lower_bound(xy,xy+n,aeiou)-xy;
        cout<<idx+1<<endl;
    }
}
0