提出 #36835585


ソースコード 拡げる

// #define NDEBUG
#include <bits/stdc++.h>

#define REP_(i, a_, b_, a, b, ...) for (int i = (a), END_##i = (b); i < END_##i; ++i)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define ALL(x) std::begin(x), std::end(x)
using Int = long long;
using Uint = unsigned long long;
using Real = long double;

template<typename T, typename U>
inline bool chmax(T &a, U b) { return a < b and ((a = b), true); }
template<typename T, typename U>
inline bool chmin(T &a, U b) { return a > b and ((a = b), true); }
template<typename T>
constexpr T kBig = std::numeric_limits<T>::max() / 2;
#if __cplusplus < 202002L
template<typename T>
inline int ssize(const T &a) { return (int) a.size(); }
#endif

template<size_t BufSize>
class InputReader {
 public:
  void skip() {
    [[maybe_unused]] static const bool lazy_init = [this]() {
      const size_t len = fread(buf_, 1, sizeof(buf_) - 1, stdin);
      buf_[len] = '\0';
      ptr_ = buf_;
      bufend_ = buf_ + len;
      return true;
    }();
    while (isspace(*ptr_)) ++ptr_;
  }

  template<typename T>
  operator T() {
    T x;
    skip();
    assert(not is_eof());
    read_one(x);
    return x;
  }

  struct Sized {
    InputReader<BufSize> &reader;
    int n;
    template<typename T>
    operator T() const {
      T xs(n);
      for (auto &x: xs) {
        reader.skip();
        assert(not reader.is_eof());
        reader.read_one(x);
      }
      return xs;
    }
  };
  Sized operator()(int n) { return {*this, n}; }

  bool is_eof() const { return ptr_ >= bufend_; }

 private:
  template<class T>
  std::enable_if_t<std::is_integral_v<T>> read_one(T &x) {
    [[maybe_unused]] int sign = 1;
    if constexpr (std::is_signed_v<T>) {
      sign = (*ptr_ == '-') ? (++ptr_, -1) : 1;
    }
    x = 0;
    while (isdigit(*ptr_)) x = x * 10 + (*ptr_++ & 0x0F);
    if constexpr (std::is_signed_v<T>) {
      x *= sign;
    }
  }
  void read_one(std::string &s) {
    char *p0 = ptr_;
    while (not isspace(*ptr_)) ptr_++;
    s.assign(p0, ptr_);
  }
  void read_one(std::string_view &s) {
    const char *p0 = ptr_;
    while (not isspace(*ptr_)) ptr_++;
    s = std::string_view(p0, ptr_ - p0);
  }

  static inline char buf_[BufSize];
  char *ptr_, *bufend_;
};
InputReader<(1 << 26)> in;

template<typename Container>
std::ostream &out_seq(const Container &seq, const char *sep = " ",
                      const char *ends = "\n", std::ostream &os = std::cout) {
  const auto itl = std::begin(seq), itr = std::end(seq);
  for (auto it = itl; it != itr; ++it) {
    if (it != itl) os << sep;
    os << *it;
  }
  return os << ends;
}

template<typename T>
std::ostream &out_one(const T &x, char endc) {
  if constexpr (std::is_same<T, bool>::value) {
    return std::cout << (x ? "Yes" : "No") << endc;
  } else {
    return std::cout << x << endc;
  }
}
template<typename T>
std::ostream &out(const T &x) {
  return out_one(x, '\n');
}
template<typename T, typename... Ts>
std::ostream &out(const T &head, Ts... tail) {
  return out_one(head, ' '), out(tail...);
}

void init_() {
  // std::ios::sync_with_stdio(false);
  // std::cin.tie(nullptr);
  std::cout << std::fixed << std::setprecision(18);
}

[[noreturn]] void exit_() {
#ifdef MY_DEBUG
  in.skip();
  assert(in.is_eof());  // Some input is left.
#endif
  fflush(stdout), fflush(stderr);
  std::cout.flush(), std::cerr.flush();
  std::_Exit(0);
}

#ifdef MY_DEBUG
#include "debug_dump.hpp"
#include "backward.hpp"
backward::SignalHandling kSignalHandling;
#else
#define DUMP(...)
#define test_case(...)
#define cerr if(false)cerr
#endif

using namespace std;

auto solve() {
  string S = in, T = in;
  out(S.find(T) != string::npos);
}

int main() {
  init_();
  const int T = 1;//in;
  REP(t, T) {
    test_case(t, T);
    (solve());
  }
  exit_();
}

提出情報

提出日時
問題 B - LOOKUP
ユーザ keijak
言語 C++ (GCC 9.2.1)
得点 200
コード長 3954 Byte
結果 AC
実行時間 8 ms
メモリ 3476 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 4
AC × 48
セット名 テストケース
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
All hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt, test_29.txt, test_30.txt, test_31.txt, test_32.txt, test_33.txt, test_34.txt, test_35.txt, test_36.txt, test_37.txt, test_38.txt, test_39.txt, test_40.txt
ケース名 結果 実行時間 メモリ
hand_01.txt AC 8 ms 3340 KiB
hand_02.txt AC 1 ms 3472 KiB
hand_03.txt AC 2 ms 3472 KiB
hand_04.txt AC 2 ms 3300 KiB
sample_01.txt AC 2 ms 3312 KiB
sample_02.txt AC 2 ms 3420 KiB
sample_03.txt AC 2 ms 3384 KiB
sample_04.txt AC 2 ms 3360 KiB
test_01.txt AC 2 ms 3412 KiB
test_02.txt AC 2 ms 3324 KiB
test_03.txt AC 2 ms 3404 KiB
test_04.txt AC 2 ms 3288 KiB
test_05.txt AC 3 ms 3280 KiB
test_06.txt AC 2 ms 3364 KiB
test_07.txt AC 2 ms 3472 KiB
test_08.txt AC 2 ms 3372 KiB
test_09.txt AC 2 ms 3476 KiB
test_10.txt AC 2 ms 3280 KiB
test_11.txt AC 2 ms 3280 KiB
test_12.txt AC 2 ms 3404 KiB
test_13.txt AC 1 ms 3304 KiB
test_14.txt AC 2 ms 3424 KiB
test_15.txt AC 2 ms 3472 KiB
test_16.txt AC 2 ms 3240 KiB
test_17.txt AC 2 ms 3300 KiB
test_18.txt AC 2 ms 3340 KiB
test_19.txt AC 2 ms 3284 KiB
test_20.txt AC 2 ms 3472 KiB
test_21.txt AC 2 ms 3376 KiB
test_22.txt AC 1 ms 3244 KiB
test_23.txt AC 1 ms 3376 KiB
test_24.txt AC 2 ms 3284 KiB
test_25.txt AC 2 ms 3400 KiB
test_26.txt AC 1 ms 3300 KiB
test_27.txt AC 2 ms 3340 KiB
test_28.txt AC 2 ms 3380 KiB
test_29.txt AC 2 ms 3392 KiB
test_30.txt AC 2 ms 3340 KiB
test_31.txt AC 2 ms 3340 KiB
test_32.txt AC 3 ms 3336 KiB
test_33.txt AC 2 ms 3284 KiB
test_34.txt AC 2 ms 3304 KiB
test_35.txt AC 2 ms 3360 KiB
test_36.txt AC 2 ms 3424 KiB
test_37.txt AC 2 ms 3284 KiB
test_38.txt AC 2 ms 3296 KiB
test_39.txt AC 2 ms 3304 KiB
test_40.txt AC 2 ms 3472 KiB