結果

問題 No.1121 Social Distancing in Cinema
ユーザー hedwig100hedwig100
提出日時 2020-07-22 21:51:42
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,296 bytes
コンパイル時間 2,266 ms
コンパイル使用メモリ 170,388 KB
実行使用メモリ 4,532 KB
最終ジャッジ日時 2023-09-04 17:49:51
合計ジャッジ時間 14,781 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,532 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 2 ms
4,384 KB
testcase_03 AC 3 ms
4,384 KB
testcase_04 AC 2 ms
4,384 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,380 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 WA -
testcase_24 WA -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
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 RE -
testcase_43 RE -
testcase_44 RE -
testcase_45 RE -
testcase_46 RE -
testcase_47 AC 2 ms
4,384 KB
testcase_48 AC 3 ms
4,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i ++)
#define irep(i,n) for (int i = (int)n - 1;i >= 0;--i)
using namespace std;
using ll = long long;
using PL = pair<ll,ll>;
using P = pair<int,int>;
constexpr int INF = 1000000000;
constexpr long long HINF = 1000000000000000;
constexpr long long MOD = 1000000007;// = 998244353;
constexpr double EPS = 1e-4;
constexpr double PI = 3.14159265358979;

int main() {
    int N; cin >> N;
    vector<vector<int>> grid(500,vector<int>(500,0));
    rep(i,N) {
        int x,y; cin >> x >> y;
        grid[x - 1][y - 1] = i + 1;
    }
    int K = 0;
    vector<int> ans;
    int ny = 0,nx = 0;
    while (K*90 < N) {
        bool flag = false;
        for (int y = ny;y < ny + 10;++y) {
            for (int x = nx; x < nx + 10;+x) {
                if (grid[y][x] > 0) {
                    ans.push_back(grid[y][x]);
                    flag = true;
                    ++K;
                    ny = y + 20;
                    if (ny > 500) {
                        ny = 0;
                        nx += 20;
                    }
                    break;
                }
            }
            if (flag) break;
        }
    }
    cout << K << '\n';
    rep(i,K) cout << ans[i] << ' ';
    cout << '\n';
    return 0;
}
0