結果
問題 | No.1121 Social Distancing in Cinema |
ユーザー | 沙耶花 |
提出日時 | 2020-07-22 22:01:28 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,398 bytes |
コンパイル時間 | 2,853 ms |
コンパイル使用メモリ | 213,988 KB |
実行使用メモリ | 7,164 KB |
最終ジャッジ日時 | 2023-09-04 20:18:16 |
合計ジャッジ時間 | 12,861 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,496 KB |
testcase_01 | AC | 2 ms
4,380 KB |
testcase_02 | AC | 2 ms
4,380 KB |
testcase_03 | AC | 3 ms
4,380 KB |
testcase_04 | AC | 2 ms
4,500 KB |
testcase_05 | AC | 2 ms
4,384 KB |
testcase_06 | AC | 2 ms
4,536 KB |
testcase_07 | AC | 2 ms
4,384 KB |
testcase_08 | AC | 2 ms
4,540 KB |
testcase_09 | AC | 2 ms
4,432 KB |
testcase_10 | AC | 2 ms
4,468 KB |
testcase_11 | AC | 3 ms
4,432 KB |
testcase_12 | AC | 3 ms
4,416 KB |
testcase_13 | AC | 3 ms
4,420 KB |
testcase_14 | AC | 5 ms
4,384 KB |
testcase_15 | AC | 10 ms
4,436 KB |
testcase_16 | AC | 35 ms
4,412 KB |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | AC | 21 ms
4,460 KB |
testcase_21 | AC | 19 ms
4,476 KB |
testcase_22 | AC | 18 ms
4,436 KB |
testcase_23 | AC | 7 ms
4,392 KB |
testcase_24 | AC | 4 ms
4,384 KB |
testcase_25 | AC | 161 ms
5,088 KB |
testcase_26 | AC | 238 ms
5,160 KB |
testcase_27 | AC | 5 ms
4,512 KB |
testcase_28 | WA | - |
testcase_29 | AC | 216 ms
4,816 KB |
testcase_30 | AC | 68 ms
4,912 KB |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | AC | 90 ms
4,812 KB |
testcase_34 | AC | 89 ms
4,936 KB |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | AC | 66 ms
4,600 KB |
testcase_38 | AC | 105 ms
5,192 KB |
testcase_39 | WA | - |
testcase_40 | AC | 54 ms
4,668 KB |
testcase_41 | AC | 16 ms
4,380 KB |
testcase_42 | WA | - |
testcase_43 | WA | - |
testcase_44 | WA | - |
testcase_45 | WA | - |
testcase_46 | WA | - |
testcase_47 | AC | 2 ms
4,416 KB |
testcase_48 | AC | 2 ms
4,384 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)); vector<pair<int,pair<int,int>>> P(N,pair<int,pair<int,int>>(0,pair<int,int>(0,0))); for(int i=0;i<N;i++){ int X,Y; scanf("%d %d",&X,&Y); ind[X][Y] = i; P[i].second.first=X; P[i].second.second=Y; } for(int i=0;i<N;i++){ for(int j=-10;j<=10;j++){ for(int k=-10;k<=10;k++){ if(k*k+j*j<100){ int x = P[i].second.first+j,y = P[i].second.second+k; if(x<0||y<0||x>500||y>500)continue; int t = ind[x][y]; if(t!=-1)P[t].first++; } } } } sort(P.rbegin(),P.rend()); vector<int> ans; while(P.size()!=0){ if((N+89)/90 <= ans.size())break; pair<int,int> T; T = P.back().second; P.pop_back(); 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; }