結果

問題 No.1121 Social Distancing in Cinema
ユーザー divinediscon10tdivinediscon10t
提出日時 2020-07-22 22:22:16
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,287 bytes
コンパイル時間 1,930 ms
コンパイル使用メモリ 177,192 KB
実行使用メモリ 25,180 KB
最終ジャッジ日時 2023-09-04 21:25:28
合計ジャッジ時間 9,559 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 4 ms
4,376 KB
testcase_21 AC 4 ms
4,380 KB
testcase_22 AC 4 ms
4,376 KB
testcase_23 AC 3 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 33 ms
9,140 KB
testcase_26 AC 41 ms
10,564 KB
testcase_27 AC 3 ms
4,376 KB
testcase_28 AC 108 ms
22,108 KB
testcase_29 AC 39 ms
10,484 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 37 ms
10,136 KB
testcase_34 AC 38 ms
10,088 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 26 ms
8,248 KB
testcase_38 AC 45 ms
11,152 KB
testcase_39 AC 108 ms
21,712 KB
testcase_40 AC 19 ms
6,928 KB
testcase_41 AC 6 ms
4,384 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 2 ms
4,380 KB
testcase_48 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(int i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    
    ll n; cin >> n;
    ll x[n], y[n]; zep(i, 0, n)cin >> x[i] >> y[i];
    
    vector<vector<ll>> v(n);
    zep(i, 0, n)v[i] = {x[i] + y[i], x[i], y[i], i + 1};
    sort(v.begin(), v.end());
    
    bool use[555][555]; memset(use, 0, sizeof(use));
    vector<ll> ans;
    zep(i, 0, n){
    	ll vx = v[i][1], vy = v[i][2];
    	
    	if(!use[vx][vy]){
    		use[vx][vy] = true;
    		ans.push_back(v[i][3]);
    		
    		rep(j, -10, 10){
    			rep(k, -10, 10){
    				if(j * j + k * k < 100){
    					if(1 <= vx + j && vx + j <= 500 && 1 <= vy + k && vy + k <= 500){
    						use[vx + j][vy + k] = true;
    						//cout << j << " " << k << endl;
    					}
    				}
    			}
    		}
    	}
    }
    
    print(ans.size())
    zep(i, 0, ans.size())cout << ans[i] << " "; cout << endl;
    
    return 0;
}
0