結果

問題 No.1121 Social Distancing in Cinema
ユーザー KoDKoD
提出日時 2020-07-22 21:52:40
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,478 bytes
コンパイル時間 15,880 ms
コンパイル使用メモリ 787,936 KB
実行使用メモリ 7,156 KB
最終ジャッジ日時 2023-09-04 17:58:37
合計ジャッジ時間 27,589 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,388 KB
testcase_01 AC 3 ms
4,400 KB
testcase_02 AC 3 ms
4,388 KB
testcase_03 AC 3 ms
4,456 KB
testcase_04 AC 3 ms
4,352 KB
testcase_05 AC 3 ms
4,520 KB
testcase_06 AC 3 ms
4,520 KB
testcase_07 AC 3 ms
4,400 KB
testcase_08 AC 3 ms
4,388 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 3 ms
4,396 KB
testcase_48 AC 3 ms
4,392 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::array<std::array<i32, 500>, 500> arr{};
    for (auto i: range(0, 500)) {
      for (auto j: range(0, 500)) {
        i32 x = i % 10;
        i32 y = j % 9;
        i32 z = j / 9;
        arr[x][y] = 10 * y + (x + z) % 10;
      }
    }
    return arr;
  }();
  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);
  }
  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;
    }
  }
  return 0;
}
0