結果
問題 | No.1121 Social Distancing in Cinema |
ユーザー | 沙耶花 |
提出日時 | 2020-07-22 21:53:35 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,134 bytes |
コンパイル時間 | 2,982 ms |
コンパイル使用メモリ | 218,148 KB |
実行使用メモリ | 6,484 KB |
最終ジャッジ日時 | 2023-09-04 18:07:23 |
合計ジャッジ時間 | 11,929 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,488 KB |
testcase_01 | AC | 2 ms
4,376 KB |
testcase_02 | AC | 2 ms
4,380 KB |
testcase_03 | AC | 2 ms
4,476 KB |
testcase_04 | AC | 2 ms
4,552 KB |
testcase_05 | AC | 2 ms
4,452 KB |
testcase_06 | AC | 2 ms
4,600 KB |
testcase_07 | AC | 2 ms
4,420 KB |
testcase_08 | AC | 2 ms
4,488 KB |
testcase_09 | AC | 2 ms
4,656 KB |
testcase_10 | AC | 2 ms
4,660 KB |
testcase_11 | AC | 2 ms
4,408 KB |
testcase_12 | AC | 2 ms
4,424 KB |
testcase_13 | AC | 3 ms
4,412 KB |
testcase_14 | AC | 3 ms
4,412 KB |
testcase_15 | AC | 4 ms
4,736 KB |
testcase_16 | AC | 9 ms
4,740 KB |
testcase_17 | AC | 27 ms
5,360 KB |
testcase_18 | AC | 50 ms
6,084 KB |
testcase_19 | RE | - |
testcase_20 | AC | 4 ms
4,616 KB |
testcase_21 | AC | 3 ms
4,444 KB |
testcase_22 | AC | 3 ms
4,460 KB |
testcase_23 | AC | 2 ms
4,676 KB |
testcase_24 | AC | 3 ms
4,668 KB |
testcase_25 | RE | - |
testcase_26 | RE | - |
testcase_27 | RE | - |
testcase_28 | RE | - |
testcase_29 | RE | - |
testcase_30 | AC | 16 ms
5,036 KB |
testcase_31 | RE | - |
testcase_32 | RE | - |
testcase_33 | RE | - |
testcase_34 | RE | - |
testcase_35 | RE | - |
testcase_36 | RE | - |
testcase_37 | RE | - |
testcase_38 | RE | - |
testcase_39 | RE | - |
testcase_40 | RE | - |
testcase_41 | RE | - |
testcase_42 | AC | 55 ms
6,364 KB |
testcase_43 | AC | 55 ms
6,304 KB |
testcase_44 | WA | - |
testcase_45 | WA | - |
testcase_46 | WA | - |
testcase_47 | AC | 3 ms
4,448 KB |
testcase_48 | AC | 2 ms
4,524 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; #define modulo 1000000007 #define mod(mod_x) ((((long long)mod_x+modulo))%modulo) #define Inf 1000000000000000002 int main(){ map<pair<int,int>,int> mp; int N; cin>>N; vector<vector<int>> ind(501,vector<int>(501,-1)); deque<pair<int,int>> P(N); for(int i=0;i<N;i++){ int X,Y; scanf("%d %d",&X,&Y); X++; Y++; ind[X][Y] = i; P[i].first=X; P[i].second=Y; } sort(P.begin(),P.end()); vector<int> ans; while(P.size()!=0){ if((N+89)/90 <= ans.size())break; pair<int,int> T; if(P.size()%2==0){ T = P.back(); P.pop_back(); } else{ T = P.front(); P.pop_front(); } if(ind[T.first][T.second]==-1){ continue; } ans.push_back(ind[T.first][T.second]); ind[T.first][T.second]=-1; int X = T.first; int Y = T.second; for(int i=-10;i<=10;i++){ for(int j=-10;j<=10;j++){ if(i*i+j*j<100){ int x = X+i,y = Y+j; if(x<0||y<0||x>500||y>500)continue; ind[x][y]=-1; } } } } cout<<ans.size()<<endl; for(int i=0;i<ans.size();i++){ if(i!=0)cout<<' '; cout<<ans[i]+1; } cout<<endl; return 0; }