結果

問題 No.1121 Social Distancing in Cinema
ユーザー KoDKoD
提出日時 2020-07-22 22:04:20
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 2,719 bytes
コンパイル時間 910 ms
コンパイル使用メモリ 83,928 KB
実行使用メモリ 7,576 KB
最終ジャッジ日時 2023-09-04 20:34:29
合計ジャッジ時間 5,680 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,384 KB
testcase_01 AC 3 ms
4,380 KB
testcase_02 AC 3 ms
4,388 KB
testcase_03 AC 3 ms
4,384 KB
testcase_04 AC 3 ms
4,384 KB
testcase_05 AC 3 ms
4,432 KB
testcase_06 AC 3 ms
4,380 KB
testcase_07 AC 3 ms
4,376 KB
testcase_08 AC 3 ms
4,508 KB
testcase_09 AC 3 ms
4,376 KB
testcase_10 AC 3 ms
4,384 KB
testcase_11 AC 3 ms
4,384 KB
testcase_12 AC 3 ms
4,388 KB
testcase_13 AC 3 ms
4,380 KB
testcase_14 AC 4 ms
4,384 KB
testcase_15 AC 6 ms
4,688 KB
testcase_16 AC 14 ms
4,896 KB
testcase_17 AC 45 ms
5,900 KB
testcase_18 AC 84 ms
7,432 KB
testcase_19 AC 98 ms
7,576 KB
testcase_20 AC 5 ms
4,464 KB
testcase_21 AC 5 ms
4,628 KB
testcase_22 AC 5 ms
4,488 KB
testcase_23 AC 4 ms
4,384 KB
testcase_24 AC 4 ms
4,504 KB
testcase_25 AC 28 ms
5,024 KB
testcase_26 AC 35 ms
5,300 KB
testcase_27 AC 4 ms
4,420 KB
testcase_28 AC 86 ms
7,224 KB
testcase_29 AC 33 ms
5,136 KB
testcase_30 AC 26 ms
5,096 KB
testcase_31 AC 98 ms
7,472 KB
testcase_32 AC 75 ms
7,060 KB
testcase_33 AC 33 ms
5,212 KB
testcase_34 AC 33 ms
5,220 KB
testcase_35 AC 79 ms
7,148 KB
testcase_36 AC 94 ms
7,448 KB
testcase_37 AC 25 ms
4,804 KB
testcase_38 AC 38 ms
5,680 KB
testcase_39 AC 84 ms
7,196 KB
testcase_40 AC 20 ms
4,748 KB
testcase_41 AC 8 ms
4,544 KB
testcase_42 AC 94 ms
7,492 KB
testcase_43 AC 94 ms
7,440 KB
testcase_44 AC 94 ms
7,516 KB
testcase_45 AC 93 ms
7,296 KB
testcase_46 AC 92 ms
7,224 KB
testcase_47 AC 3 ms
4,388 KB
testcase_48 AC 3 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#line 1 "main.cpp"

/**
 * @title Template
 */

#include <iostream>
#include <algorithm>
#include <utility>
#include <numeric>
#include <vector>
#include <array>

template <class T, class U>
inline bool chmin(T &lhs, const U &rhs) {
  if (lhs > rhs) { lhs = rhs; return true; }
  return false;
}

template <class T, class U>
inline bool chmax(T &lhs, const U &rhs) {
  if (lhs < rhs) { lhs = rhs; return true; }
  return false;
}

struct range {
  using itr = int64_t;
  struct iterator {
    itr i;
    constexpr iterator(itr i_) noexcept : i(i_) { }
    constexpr void operator ++ () noexcept { ++i; }
    constexpr itr operator * () const noexcept { return i; }
    constexpr bool operator != (iterator x) const noexcept { return i != x.i; }
  };
  const iterator l, r;
  constexpr range(itr l_, itr r_) noexcept : l(l_), r(std::max(l_, r_)) { }
  constexpr iterator begin() const noexcept { return l; }
  constexpr iterator end() const noexcept { return r; }
};

struct revrange {
  using itr = int64_t;
  struct iterator {
    itr i;
    constexpr iterator(itr i_) noexcept : i(i_) { }
    constexpr void operator ++ () noexcept { --i; }
    constexpr itr operator * () const noexcept { return i; }
    constexpr bool operator != (iterator x) const noexcept { return i != x.i; }
  };
  const iterator l, r;
  constexpr revrange(itr l_, itr r_) noexcept : l(l_ - 1), r(std::max(l_, r_) - 1) { }
  constexpr iterator begin() const noexcept { return r; }
  constexpr iterator end() const noexcept { return l; }
};

using i32 = int32_t;
using i64 = int64_t;
using u32 = uint32_t;
using u64 = uint64_t;

constexpr i32 inf32 = (i32(1) << 30) - 1;
constexpr i64 inf64 = (i64(1) << 62) - 1;

int main() {
  size_t N;
  std::cin >> N;
  std::vector<i32> X(N), Y(N);
  auto idx = [] {
    std::vector<std::vector<i32>> arr(500, std::vector<i32>(500));
    for (auto i: range(0, 500)) {
      for (auto j: range(0, 500)) {
        i32 x = i % 10;
        i32 y = j % 9;
        i32 z = (j / 9) % 2 * 5;
        arr[i][j] = 10 * y + (x + z) % 10;
      }
    }
    return arr;
  }();
  // for (auto i: range(0, 30)) {
  //   for (auto j: range(0, 30)) {
  //     std::cout << idx[i][j] << ' ';
  //   }
  //   std::cout << '\n';
  // }
  std::array<std::vector<i32>, 90> group{};
  for (auto i: range(0, N)) {
    std::cin >> X[i] >> Y[i];
    --X[i]; --Y[i];
    group[idx[X[i]][Y[i]]].push_back(i);
    // std::cout << idx[X[i]][Y[i]] << '\n';
  }
  for (auto &vec: group) {
    if (vec.size() * 90 >= N) {
      std::cout << vec.size() << '\n';
      for (auto i: range(0, vec.size())) {
        std::cout << vec[i] + 1 << (i + 1 == vec.size() ? '\n' : ' ');
      }
      return 0;
    }
  }
  std::exit(1);
  return 0;
}
0