結果

問題 No.1121 Social Distancing in Cinema
ユーザー Shun_PIShun_PI
提出日時 2020-07-22 22:07:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,343 bytes
コンパイル時間 1,755 ms
コンパイル使用メモリ 171,592 KB
実行使用メモリ 4,672 KB
最終ジャッジ日時 2023-09-04 20:43:03
合計ジャッジ時間 5,920 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 3 ms
4,380 KB
testcase_02 AC 3 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 3 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 3 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 3 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 3 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 3 ms
4,380 KB
testcase_14 AC 3 ms
4,380 KB
testcase_15 AC 4 ms
4,380 KB
testcase_16 AC 7 ms
4,384 KB
testcase_17 AC 18 ms
4,384 KB
testcase_18 AC 30 ms
4,536 KB
testcase_19 AC 34 ms
4,380 KB
testcase_20 AC 3 ms
4,380 KB
testcase_21 AC 3 ms
4,376 KB
testcase_22 AC 3 ms
4,376 KB
testcase_23 AC 3 ms
4,376 KB
testcase_24 AC 3 ms
4,376 KB
testcase_25 AC 12 ms
4,416 KB
testcase_26 AC 14 ms
4,452 KB
testcase_27 AC 3 ms
4,380 KB
testcase_28 AC 29 ms
4,464 KB
testcase_29 AC 13 ms
4,436 KB
testcase_30 AC 10 ms
4,388 KB
testcase_31 AC 35 ms
4,424 KB
testcase_32 AC 27 ms
4,380 KB
testcase_33 AC 13 ms
4,548 KB
testcase_34 AC 13 ms
4,380 KB
testcase_35 AC 29 ms
4,468 KB
testcase_36 AC 32 ms
4,380 KB
testcase_37 AC 10 ms
4,396 KB
testcase_38 AC 14 ms
4,452 KB
testcase_39 AC 29 ms
4,392 KB
testcase_40 AC 8 ms
4,580 KB
testcase_41 AC 4 ms
4,488 KB
testcase_42 AC 33 ms
4,448 KB
testcase_43 AC 33 ms
4,440 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 3 ms
4,380 KB
testcase_48 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using P = pair<int, int>;
using PL = pair<lint, lint>;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
constexpr int MOD = 1000000007;
constexpr int INF = 2147483647;
void yes(bool expr) {cout << (expr ? "Yes" : "No") << "\n";}
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int N;
  cin >> N;
  //N = 250000;
  int K = (N-1) / 90 + 1;
  vector<vector<int>> b(500, vector<int>(500));
  REP(i, N) {
    int X, Y;
    cin >> X >> Y;
    //X = i/500 + 1; Y = i%500 + 1;
    b[X-1][Y-1] = i+1;
  }
  vector<int> ans;
  vector<int> delsize = {10, 10, 10, 10, 10, 9, 8, 8, 6, 5};
  REP(i, 500) REP(j, 500) {
    if(b[i][j] > 0) {
      ans.push_back(b[i][j]);
      REP(k, 10) REP(l, delsize[k]) if(i+k < 500 && j+l < 500) b[i+k][j+l] = 0;
      REP(k, 10) REP(l, delsize[k]) if(i+k < 500 && j-l >= 0) b[i+k][j-l] = 0;
    }
  }
  cout << ans.size() << "\n";

  //cout << K << "\n";
  if(ans.size() < K) {
    cout << "NG" << endl;
    return 0;
  }

  REP(i, ans.size()) cout << ans[i] << (i!=ans.size()-1 ? " " : "");
  cout << "\n";
}
0