結果

問題 No.1121 Social Distancing in Cinema
ユーザー betrue12betrue12
提出日時 2020-07-22 23:21:21
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 1,052 bytes
コンパイル時間 2,363 ms
コンパイル使用メモリ 203,888 KB
実行使用メモリ 5,740 KB
最終ジャッジ日時 2023-09-05 04:30:43
合計ジャッジ時間 8,522 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,384 KB
testcase_01 AC 3 ms
4,384 KB
testcase_02 AC 3 ms
4,400 KB
testcase_03 AC 3 ms
4,384 KB
testcase_04 AC 3 ms
4,388 KB
testcase_05 AC 3 ms
4,384 KB
testcase_06 AC 3 ms
4,384 KB
testcase_07 AC 3 ms
4,384 KB
testcase_08 AC 3 ms
4,380 KB
testcase_09 AC 3 ms
4,384 KB
testcase_10 AC 3 ms
4,388 KB
testcase_11 AC 3 ms
4,384 KB
testcase_12 AC 3 ms
4,384 KB
testcase_13 AC 3 ms
4,384 KB
testcase_14 AC 4 ms
4,424 KB
testcase_15 AC 5 ms
4,380 KB
testcase_16 AC 14 ms
4,516 KB
testcase_17 AC 45 ms
4,876 KB
testcase_18 AC 82 ms
5,380 KB
testcase_19 AC 98 ms
5,540 KB
testcase_20 AC 6 ms
4,388 KB
testcase_21 AC 5 ms
4,384 KB
testcase_22 AC 5 ms
4,384 KB
testcase_23 AC 4 ms
4,396 KB
testcase_24 AC 4 ms
4,380 KB
testcase_25 AC 28 ms
4,908 KB
testcase_26 AC 35 ms
4,752 KB
testcase_27 AC 4 ms
4,388 KB
testcase_28 AC 85 ms
5,636 KB
testcase_29 AC 33 ms
4,780 KB
testcase_30 AC 26 ms
4,720 KB
testcase_31 AC 98 ms
5,624 KB
testcase_32 AC 74 ms
5,444 KB
testcase_33 AC 33 ms
4,584 KB
testcase_34 AC 33 ms
4,720 KB
testcase_35 AC 79 ms
5,568 KB
testcase_36 AC 95 ms
5,440 KB
testcase_37 AC 25 ms
4,728 KB
testcase_38 AC 38 ms
4,896 KB
testcase_39 AC 85 ms
5,692 KB
testcase_40 AC 19 ms
4,692 KB
testcase_41 AC 8 ms
4,464 KB
testcase_42 AC 93 ms
5,548 KB
testcase_43 AC 92 ms
5,392 KB
testcase_44 AC 92 ms
5,424 KB
testcase_45 AC 92 ms
5,376 KB
testcase_46 AC 90 ms
5,740 KB
testcase_47 AC 3 ms
4,384 KB
testcase_48 AC 3 ms
4,584 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    int G[500][500];
    auto inside = [&](int a, int b){ return a>=0 && a<500 && b>=0 && b<500; };
    
    vector<pair<int, int>> SS = {{-1, -4}, {4, 5}};
    int num[] = {1, 2, 3, 4, 5, 5, 5, 5, 5, 4, 3, 2, 1};
    for(auto [SX, SY] : SS){
        for(int sx=SX; sx<=600; sx+=10) for(int sy=SY; sy<=600; sy+=18){
            int g = 0;
            for(int ay=0; ay<13; ay++){
                int n = num[ay];
                for(int ax=1-n; ax<=n; ax++){
                    int i = sx+ax, j = sy+ay;
                    if(inside(i, j)) G[i][j] = g;
                    g++;
                }
            }
        }
    }

    vector<int> vs[90];
    int N;
    cin >> N;
    for(int i=0; i<N; i++){
        int x, y;
        cin >> x >> y;
        vs[G[x-1][y-1]].push_back(i);
    }
    int opt = 0;
    for(int g=0; g<90; g++) if(vs[opt].size() < vs[g].size()) opt = g;
    cout << vs[opt].size() << endl;
    for(int a : vs[opt]) cout << a+1 << " ";
    cout << endl;
    return 0;
}
0