結果
| 問題 |
No.1121 Social Distancing in Cinema
|
| コンテスト | |
| ユーザー |
Ilag
|
| 提出日時 | 2020-07-22 23:52:38 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,354 bytes |
| コンパイル時間 | 1,613 ms |
| コンパイル使用メモリ | 176,376 KB |
| 実行使用メモリ | 15,324 KB |
| 最終ジャッジ日時 | 2024-06-23 02:07:18 |
| 合計ジャッジ時間 | 9,469 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 WA * 38 |
ソースコード
#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+=9){
for(int j=0;j<=maxy;j+=9){
vec.emplace_back(rev[cmp[j][i].first][cmp[j][i].second]);
}
}
cout<<vec.size()<<endl;
for(auto aeiou:vec){
int idx=lower_bound(xy,xy+n,aeiou)-xy;
cout<<idx+1<<endl;
}
}
Ilag