QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#860509 | #9981. Collatz Conjecture | ucup-team087# | AC ✓ | 15ms | 3968kb | C++23 | 15.5kb | 2025-01-18 13:47:15 | 2025-01-18 13:47:23 |
Judging History
answer
#line 1 "library/my_template.hpp"
#if defined(LOCAL)
#include <my_template_compiled.hpp>
#else
// https://codeforces.com/blog/entry/96344
#pragma GCC optimize("Ofast,unroll-loops")
// いまの CF だとこれ入れると動かない?
// #pragma GCC target("avx2,popcnt")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i128 = __int128;
using u128 = unsigned __int128;
using f128 = __float128;
template <class T>
constexpr T infty = 0;
template <>
constexpr int infty<int> = 1'010'000'000;
template <>
constexpr ll infty<ll> = 2'020'000'000'000'000'000;
template <>
constexpr u32 infty<u32> = infty<int>;
template <>
constexpr u64 infty<u64> = infty<ll>;
template <>
constexpr i128 infty<i128> = i128(infty<ll>) * 2'000'000'000'000'000'000;
template <>
constexpr double infty<double> = infty<ll>;
template <>
constexpr long double infty<long double> = infty<ll>;
using pi = pair<ll, ll>;
using vi = vector<ll>;
template <class T>
using vc = vector<T>;
template <class T>
using vvc = vector<vc<T>>;
template <class T>
using vvvc = vector<vvc<T>>;
template <class T>
using vvvvc = vector<vvvc<T>>;
template <class T>
using vvvvvc = vector<vvvvc<T>>;
template <class T>
using pq = priority_queue<T>;
template <class T>
using pqg = priority_queue<T, vector<T>, greater<T>>;
#define vv(type, name, h, ...) vector<vector<type>> name(h, vector<type>(__VA_ARGS__))
#define vvv(type, name, h, w, ...) vector<vector<vector<type>>> name(h, vector<vector<type>>(w, vector<type>(__VA_ARGS__)))
#define vvvv(type, name, a, b, c, ...) \
vector<vector<vector<vector<type>>>> name(a, vector<vector<vector<type>>>(b, vector<vector<type>>(c, vector<type>(__VA_ARGS__))))
// https://trap.jp/post/1224/
#define FOR1(a) for (ll _ = 0; _ < ll(a); ++_)
#define FOR2(i, a) for (ll i = 0; i < ll(a); ++i)
#define FOR3(i, a, b) for (ll i = a; i < ll(b); ++i)
#define FOR4(i, a, b, c) for (ll i = a; i < ll(b); i += (c))
#define FOR1_R(a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR2_R(i, a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR3_R(i, a, b) for (ll i = (b)-1; i >= ll(a); --i)
#define overload4(a, b, c, d, e, ...) e
#define overload3(a, b, c, d, ...) d
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FOR_R(...) overload3(__VA_ARGS__, FOR3_R, FOR2_R, FOR1_R)(__VA_ARGS__)
#define all(x) x.begin(), x.end()
#define len(x) ll(x.size())
#define elif else if
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define stoi stoll
int popcnt(int x) { return __builtin_popcount(x); }
int popcnt(u32 x) { return __builtin_popcount(x); }
int popcnt(ll x) { return __builtin_popcountll(x); }
int popcnt(u64 x) { return __builtin_popcountll(x); }
int popcnt_sgn(int x) { return (__builtin_parity(unsigned(x)) & 1 ? -1 : 1); }
int popcnt_sgn(u32 x) { return (__builtin_parity(x) & 1 ? -1 : 1); }
int popcnt_sgn(ll x) { return (__builtin_parityll(x) & 1 ? -1 : 1); }
int popcnt_sgn(u64 x) { return (__builtin_parityll(x) & 1 ? -1 : 1); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 1, 2)
int topbit(int x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(u32 x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(ll x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
int topbit(u64 x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 0, 2)
int lowbit(int x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(u32 x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(ll x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
int lowbit(u64 x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
template <typename T>
T kth_bit(int k) {
return T(1) << k;
}
template <typename T>
bool has_kth_bit(T x, int k) {
return x >> k & 1;
}
template <typename UINT>
struct all_bit {
struct iter {
UINT s;
iter(UINT s) : s(s) {}
int operator*() const { return lowbit(s); }
iter &operator++() {
s &= s - 1;
return *this;
}
bool operator!=(const iter) const { return s != 0; }
};
UINT s;
all_bit(UINT s) : s(s) {}
iter begin() const { return iter(s); }
iter end() const { return iter(0); }
};
template <typename UINT>
struct all_subset {
static_assert(is_unsigned<UINT>::value);
struct iter {
UINT s, t;
bool ed;
iter(UINT s) : s(s), t(s), ed(0) {}
int operator*() const { return s ^ t; }
iter &operator++() {
(t == 0 ? ed = 1 : t = (t - 1) & s);
return *this;
}
bool operator!=(const iter) const { return !ed; }
};
UINT s;
all_subset(UINT s) : s(s) {}
iter begin() const { return iter(s); }
iter end() const { return iter(0); }
};
template <typename T>
T floor(T a, T b) {
return a / b - (a % b && (a ^ b) < 0);
}
template <typename T>
T ceil(T x, T y) {
return floor(x + y - 1, y);
}
template <typename T>
T bmod(T x, T y) {
return x - y * floor(x, y);
}
template <typename T>
pair<T, T> divmod(T x, T y) {
T q = floor(x, y);
return {q, x - q * y};
}
template <typename T, typename U>
T SUM(const vector<U> &A) {
T sm = 0;
for (auto &&a: A) sm += a;
return sm;
}
#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))
#define LB(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define UB(c, x) distance((c).begin(), upper_bound(all(c), (x)))
#define UNIQUE(x) sort(all(x)), x.erase(unique(all(x)), x.end()), x.shrink_to_fit()
template <typename T>
T POP(deque<T> &que) {
T a = que.front();
que.pop_front();
return a;
}
template <typename T>
T POP(pq<T> &que) {
T a = que.top();
que.pop();
return a;
}
template <typename T>
T POP(pqg<T> &que) {
T a = que.top();
que.pop();
return a;
}
template <typename T>
T POP(vc<T> &que) {
T a = que.back();
que.pop_back();
return a;
}
template <typename F>
ll binary_search(F check, ll ok, ll ng, bool check_ok = true) {
if (check_ok) assert(check(ok));
while (abs(ok - ng) > 1) {
auto x = (ng + ok) / 2;
(check(x) ? ok : ng) = x;
}
return ok;
}
template <typename F>
double binary_search_real(F check, double ok, double ng, int iter = 100) {
FOR(iter) {
double x = (ok + ng) / 2;
(check(x) ? ok : ng) = x;
}
return (ok + ng) / 2;
}
template <class T, class S>
inline bool chmax(T &a, const S &b) {
return (a < b ? a = b, 1 : 0);
}
template <class T, class S>
inline bool chmin(T &a, const S &b) {
return (a > b ? a = b, 1 : 0);
}
// ? は -1
vc<int> s_to_vi(const string &S, char first_char) {
vc<int> A(S.size());
FOR(i, S.size()) { A[i] = (S[i] != '?' ? S[i] - first_char : -1); }
return A;
}
template <typename T, typename U>
vector<T> cumsum(vector<U> &A, int off = 1) {
int N = A.size();
vector<T> B(N + 1);
FOR(i, N) { B[i + 1] = B[i] + A[i]; }
if (off == 0) B.erase(B.begin());
return B;
}
// stable sort
template <typename T>
vector<int> argsort(const vector<T> &A) {
vector<int> ids(len(A));
iota(all(ids), 0);
sort(all(ids), [&](int i, int j) { return (A[i] == A[j] ? i < j : A[i] < A[j]); });
return ids;
}
// A[I[0]], A[I[1]], ...
template <typename T>
vc<T> rearrange(const vc<T> &A, const vc<int> &I) {
vc<T> B(len(I));
FOR(i, len(I)) B[i] = A[I[i]];
return B;
}
template <typename T, typename... Vectors>
void concat(vc<T> &first, const Vectors &... others) {
vc<T> &res = first;
(res.insert(res.end(), others.begin(), others.end()), ...);
}
#endif
#line 1 "library/other/io.hpp"
#define FASTIO
#include <unistd.h>
// https://judge.yosupo.jp/submission/21623
namespace fastio {
static constexpr uint32_t SZ = 1 << 17;
char ibuf[SZ];
char obuf[SZ];
char out[100];
// pointer of ibuf, obuf
uint32_t pil = 0, pir = 0, por = 0;
struct Pre {
char num[10000][4];
constexpr Pre() : num() {
for (int i = 0; i < 10000; i++) {
int n = i;
for (int j = 3; j >= 0; j--) {
num[i][j] = n % 10 | '0';
n /= 10;
}
}
}
} constexpr pre;
inline void load() {
memcpy(ibuf, ibuf + pil, pir - pil);
pir = pir - pil + fread(ibuf + pir - pil, 1, SZ - pir + pil, stdin);
pil = 0;
if (pir < SZ) ibuf[pir++] = '\n';
}
inline void flush() {
fwrite(obuf, 1, por, stdout);
por = 0;
}
void rd(char &c) {
do {
if (pil + 1 > pir) load();
c = ibuf[pil++];
} while (isspace(c));
}
void rd(string &x) {
x.clear();
char c;
do {
if (pil + 1 > pir) load();
c = ibuf[pil++];
} while (isspace(c));
do {
x += c;
if (pil == pir) load();
c = ibuf[pil++];
} while (!isspace(c));
}
template <typename T>
void rd_real(T &x) {
string s;
rd(s);
x = stod(s);
}
template <typename T>
void rd_integer(T &x) {
if (pil + 100 > pir) load();
char c;
do
c = ibuf[pil++];
while (c < '-');
bool minus = 0;
if constexpr (is_signed<T>::value || is_same_v<T, i128>) {
if (c == '-') { minus = 1, c = ibuf[pil++]; }
}
x = 0;
while ('0' <= c) { x = x * 10 + (c & 15), c = ibuf[pil++]; }
if constexpr (is_signed<T>::value || is_same_v<T, i128>) {
if (minus) x = -x;
}
}
void rd(int &x) { rd_integer(x); }
void rd(ll &x) { rd_integer(x); }
void rd(i128 &x) { rd_integer(x); }
void rd(u32 &x) { rd_integer(x); }
void rd(u64 &x) { rd_integer(x); }
void rd(u128 &x) { rd_integer(x); }
void rd(double &x) { rd_real(x); }
void rd(long double &x) { rd_real(x); }
void rd(f128 &x) { rd_real(x); }
template <class T, class U>
void rd(pair<T, U> &p) {
return rd(p.first), rd(p.second);
}
template <size_t N = 0, typename T>
void rd_tuple(T &t) {
if constexpr (N < std::tuple_size<T>::value) {
auto &x = std::get<N>(t);
rd(x);
rd_tuple<N + 1>(t);
}
}
template <class... T>
void rd(tuple<T...> &tpl) {
rd_tuple(tpl);
}
template <size_t N = 0, typename T>
void rd(array<T, N> &x) {
for (auto &d: x) rd(d);
}
template <class T>
void rd(vc<T> &x) {
for (auto &d: x) rd(d);
}
void read() {}
template <class H, class... T>
void read(H &h, T &... t) {
rd(h), read(t...);
}
void wt(const char c) {
if (por == SZ) flush();
obuf[por++] = c;
}
void wt(const string s) {
for (char c: s) wt(c);
}
void wt(const char *s) {
size_t len = strlen(s);
for (size_t i = 0; i < len; i++) wt(s[i]);
}
template <typename T>
void wt_integer(T x) {
if (por > SZ - 100) flush();
if (x < 0) { obuf[por++] = '-', x = -x; }
int outi;
for (outi = 96; x >= 10000; outi -= 4) {
memcpy(out + outi, pre.num[x % 10000], 4);
x /= 10000;
}
if (x >= 1000) {
memcpy(obuf + por, pre.num[x], 4);
por += 4;
} else if (x >= 100) {
memcpy(obuf + por, pre.num[x] + 1, 3);
por += 3;
} else if (x >= 10) {
int q = (x * 103) >> 10;
obuf[por] = q | '0';
obuf[por + 1] = (x - q * 10) | '0';
por += 2;
} else
obuf[por++] = x | '0';
memcpy(obuf + por, out + outi + 4, 96 - outi);
por += 96 - outi;
}
template <typename T>
void wt_real(T x) {
ostringstream oss;
oss << fixed << setprecision(15) << double(x);
string s = oss.str();
wt(s);
}
void wt(int x) { wt_integer(x); }
void wt(ll x) { wt_integer(x); }
void wt(i128 x) { wt_integer(x); }
void wt(u32 x) { wt_integer(x); }
void wt(u64 x) { wt_integer(x); }
void wt(u128 x) { wt_integer(x); }
void wt(double x) { wt_real(x); }
void wt(long double x) { wt_real(x); }
void wt(f128 x) { wt_real(x); }
template <class T, class U>
void wt(const pair<T, U> val) {
wt(val.first);
wt(' ');
wt(val.second);
}
template <size_t N = 0, typename T>
void wt_tuple(const T t) {
if constexpr (N < std::tuple_size<T>::value) {
if constexpr (N > 0) { wt(' '); }
const auto x = std::get<N>(t);
wt(x);
wt_tuple<N + 1>(t);
}
}
template <class... T>
void wt(tuple<T...> tpl) {
wt_tuple(tpl);
}
template <class T, size_t S>
void wt(const array<T, S> val) {
auto n = val.size();
for (size_t i = 0; i < n; i++) {
if (i) wt(' ');
wt(val[i]);
}
}
template <class T>
void wt(const vector<T> val) {
auto n = val.size();
for (size_t i = 0; i < n; i++) {
if (i) wt(' ');
wt(val[i]);
}
}
void print() { wt('\n'); }
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
wt(head);
if (sizeof...(Tail)) wt(' ');
print(forward<Tail>(tail)...);
}
// gcc expansion. called automaticall after main.
void __attribute__((destructor)) _d() { flush(); }
} // namespace fastio
using fastio::read;
using fastio::print;
using fastio::flush;
#if defined(LOCAL)
#define SHOW(...) SHOW_IMPL(__VA_ARGS__, SHOW6, SHOW5, SHOW4, SHOW3, SHOW2, SHOW1)(__VA_ARGS__)
#define SHOW_IMPL(_1, _2, _3, _4, _5, _6, NAME, ...) NAME
#define SHOW1(x) print(#x, "=", (x)), flush()
#define SHOW2(x, y) print(#x, "=", (x), #y, "=", (y)), flush()
#define SHOW3(x, y, z) print(#x, "=", (x), #y, "=", (y), #z, "=", (z)), flush()
#define SHOW4(x, y, z, w) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w)), flush()
#define SHOW5(x, y, z, w, v) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w), #v, "=", (v)), flush()
#define SHOW6(x, y, z, w, v, u) print(#x, "=", (x), #y, "=", (y), #z, "=", (z), #w, "=", (w), #v, "=", (v), #u, "=", (u)), flush()
#else
#define SHOW(...)
#endif
#define INT(...) \
int __VA_ARGS__; \
read(__VA_ARGS__)
#define LL(...) \
ll __VA_ARGS__; \
read(__VA_ARGS__)
#define U32(...) \
u32 __VA_ARGS__; \
read(__VA_ARGS__)
#define U64(...) \
u64 __VA_ARGS__; \
read(__VA_ARGS__)
#define STR(...) \
string __VA_ARGS__; \
read(__VA_ARGS__)
#define CHAR(...) \
char __VA_ARGS__; \
read(__VA_ARGS__)
#define DBL(...) \
double __VA_ARGS__; \
read(__VA_ARGS__)
#define VEC(type, name, size) \
vector<type> name(size); \
read(name)
#define VV(type, name, h, w) \
vector<vector<type>> name(h, vector<type>(w)); \
read(name)
void YES(bool t = 1) { print(t ? "YES" : "NO"); }
void NO(bool t = 1) { YES(!t); }
void Yes(bool t = 1) { print(t ? "Yes" : "No"); }
void No(bool t = 1) { Yes(!t); }
void yes(bool t = 1) { print(t ? "yes" : "no"); }
void no(bool t = 1) { yes(!t); }
void YA(bool t = 1) { print(t ? "YA" : "TIDAK"); }
void TIDAK(bool t = 1) { YES(!t); }
#line 2 "library/mod/mod_inv.hpp"
// long でも大丈夫
// (val * x - 1) が mod の倍数になるようにする
// 特に mod=0 なら x=0 が満たす
ll mod_inv(ll val, ll mod) {
if (mod == 0) return 0;
mod = abs(mod);
val %= mod;
if (val < 0) val += mod;
ll a = val, b = mod, u = 1, v = 0, t;
while (b > 0) {
t = a / b;
swap(a -= t * b, b), swap(u -= t * v, v);
}
if (u < 0) u += mod;
return u;
}
#line 4 "main.cpp"
void test(ll a, ll b) {
for (ll x = 1; x <= 1000; ++x) {
ll s = x;
vi path;
while (len(path) < 1000) {
if (s % a == 0) {
s /= a;
path.eb(s);
} else {
s += b;
}
}
path = {path.begin() + 100, path.end()};
assert(MAX(path) <= b);
}
print("OK", a, b);
flush();
}
void solve() {
LL(a, b, N);
ll x = N;
x %= b;
if (x == 0) x += b;
// x -> a の倍数になるまで足す
ll k = mod_inv(b, a);
k = bmod(k * (-x), a);
Yes(x <= N && N <= x + k * b);
}
signed main() {
// FOR(a, 2, 50) FOR(b, 1, 50) {
// if (gcd(a, b) == 1) test(a, b);
// }
// return 0;
INT(T);
FOR(T) solve();
return 0;
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3584kb
input:
7 2 1 1 2 1 2 2 1 3 2 1 100 314 159 265 314 159 2653 314 159 26535
output:
Yes Yes No No Yes Yes No
result:
ok 7 tokens
Test #2:
score: 0
Accepted
time: 4ms
memory: 3840kb
input:
100000 123 457 1 123 457 2 123 457 3 123 457 4 123 457 5 123 457 6 123 457 7 123 457 8 123 457 9 123 457 10 123 457 11 123 457 12 123 457 13 123 457 14 123 457 15 123 457 16 123 457 17 123 457 18 123 457 19 123 457 20 123 457 21 123 457 22 123 457 23 123 457 24 123 457 25 123 457 26 123 457 27 123 4...
output:
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes ...
result:
ok 100000 tokens
Test #3:
score: 0
Accepted
time: 5ms
memory: 3968kb
input:
100000 457 123 1 457 123 2 457 123 3 457 123 4 457 123 5 457 123 6 457 123 7 457 123 8 457 123 9 457 123 10 457 123 11 457 123 12 457 123 13 457 123 14 457 123 15 457 123 16 457 123 17 457 123 18 457 123 19 457 123 20 457 123 21 457 123 22 457 123 23 457 123 24 457 123 25 457 123 26 457 123 27 457 1...
output:
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes ...
result:
ok 100000 tokens
Test #4:
score: 0
Accepted
time: 4ms
memory: 3968kb
input:
100000 3 100000 1 3 100000 2 3 100000 3 3 100000 4 3 100000 5 3 100000 6 3 100000 7 3 100000 8 3 100000 9 3 100000 10 3 100000 11 3 100000 12 3 100000 13 3 100000 14 3 100000 15 3 100000 16 3 100000 17 3 100000 18 3 100000 19 3 100000 20 3 100000 21 3 100000 22 3 100000 23 3 100000 24 3 100000 25 3 ...
output:
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes ...
result:
ok 100000 tokens
Test #5:
score: 0
Accepted
time: 2ms
memory: 3968kb
input:
100000 100000 3 1 100000 3 2 100000 3 3 100000 3 4 100000 3 5 100000 3 6 100000 3 7 100000 3 8 100000 3 9 100000 3 10 100000 3 11 100000 3 12 100000 3 13 100000 3 14 100000 3 15 100000 3 16 100000 3 17 100000 3 18 100000 3 19 100000 3 20 100000 3 21 100000 3 22 100000 3 23 100000 3 24 100000 3 25 10...
output:
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes ...
result:
ok 100000 tokens
Test #6:
score: 0
Accepted
time: 5ms
memory: 3968kb
input:
100000 1234 567 1 1234 567 2 1234 567 3 1234 567 4 1234 567 5 1234 567 6 1234 567 7 1234 567 8 1234 567 9 1234 567 10 1234 567 11 1234 567 12 1234 567 13 1234 567 14 1234 567 15 1234 567 16 1234 567 17 1234 567 18 1234 567 19 1234 567 20 1234 567 21 1234 567 22 1234 567 23 1234 567 24 1234 567 25 12...
output:
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes ...
result:
ok 100000 tokens
Test #7:
score: 0
Accepted
time: 4ms
memory: 3968kb
input:
100000 567 1234 1 567 1234 2 567 1234 3 567 1234 4 567 1234 5 567 1234 6 567 1234 7 567 1234 8 567 1234 9 567 1234 10 567 1234 11 567 1234 12 567 1234 13 567 1234 14 567 1234 15 567 1234 16 567 1234 17 567 1234 18 567 1234 19 567 1234 20 567 1234 21 567 1234 22 567 1234 23 567 1234 24 567 1234 25 56...
output:
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes ...
result:
ok 100000 tokens
Test #8:
score: 0
Accepted
time: 4ms
memory: 3968kb
input:
100000 11 20000 1 11 20000 2 11 20000 3 11 20000 4 11 20000 5 11 20000 6 11 20000 7 11 20000 8 11 20000 9 11 20000 10 11 20000 11 11 20000 12 11 20000 13 11 20000 14 11 20000 15 11 20000 16 11 20000 17 11 20000 18 11 20000 19 11 20000 20 11 20000 21 11 20000 22 11 20000 23 11 20000 24 11 20000 25 11...
output:
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes ...
result:
ok 100000 tokens
Test #9:
score: 0
Accepted
time: 3ms
memory: 3968kb
input:
100000 20000 11 1 20000 11 2 20000 11 3 20000 11 4 20000 11 5 20000 11 6 20000 11 7 20000 11 8 20000 11 9 20000 11 10 20000 11 11 20000 11 12 20000 11 13 20000 11 14 20000 11 15 20000 11 16 20000 11 17 20000 11 18 20000 11 19 20000 11 20 20000 11 21 20000 11 22 20000 11 23 20000 11 24 20000 11 25 20...
output:
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes ...
result:
ok 100000 tokens
Test #10:
score: 0
Accepted
time: 3ms
memory: 3968kb
input:
100000 10 9 46 7 10 75 8 5 28 2 9 25 8 3 14 6 1 11 6 7 43 10 1 100 6 7 7 10 9 74 8 9 25 4 7 23 6 5 32 10 7 67 2 5 9 7 2 9 8 3 24 3 10 72 7 8 80 2 9 63 9 4 89 9 7 65 3 2 23 7 4 83 8 7 54 5 2 83 8 7 67 9 8 7 8 3 5 7 2 21 9 10 64 5 1 58 8 9 64 7 6 92 3 7 85 3 4 81 3 7 52 8 3 93 8 3 49 10 3 63 8 5 62 3 ...
output:
No No No No No No No No Yes No No No No No No No Yes No No No No No No No No No No Yes Yes No No No Yes No No No No No No No No No No Yes No Yes No Yes No No No Yes No No Yes No No Yes Yes No No No No No Yes No No No No No No No No No Yes No No No No No No No Yes No No No No No No No No Yes Yes No N...
result:
ok 100000 tokens
Test #11:
score: 0
Accepted
time: 6ms
memory: 3968kb
input:
100000 734 721 305043 803 570 314107 151 173 961985 99 158 637673 223 992 251278 128 675 45643 37 515 402356 920 643 166597 607 246 261024 922 153 82929 963 845 862581 525 898 55977 471 734 239060 401 155 140267 416 587 162998 646 835 165455 115 263 455493 526 965 19267 747 968 848208 485 58 581362 ...
output:
No Yes No No No No No No No No No Yes No No No Yes No Yes No No No No No No Yes No No No No No No No No No Yes No No No No Yes Yes No No No No No No No No No No No No No Yes No No No No No No No Yes No No No Yes No No No No No No No No No No Yes No Yes No Yes No Yes No No No No No Yes No No No No No...
result:
ok 100000 tokens
Test #12:
score: 0
Accepted
time: 9ms
memory: 3968kb
input:
100000 32231 92266 782178617 42230 96003 6217695170 80182 12377 8701700997 31033 52983 6302513359 62119 12786 1119273204 47041 95623 9096117073 31597 62488 6503179735 68149 95382 7983811944 43779 23956 7205672312 42079 13667 8875242043 74808 71447 2510801750 30403 25937 7075700089 23049 52477 533016...
output:
No No No No No No No No No No Yes No No Yes No No No No No No Yes Yes Yes No No No No No No No No No No No No No No No No No Yes No Yes No No No No No No No No No No No No No No No Yes No No No No No No No No Yes No No No No No No No No No No No No No No Yes No Yes No No No Yes No No Yes No No No No...
result:
ok 100000 tokens
Test #13:
score: 0
Accepted
time: 12ms
memory: 3968kb
input:
100000 3810923 5708808 87470435846326 5965262 5386583 90515929776547 3844735 7834949 51374503391657 4252291 1624223 55591304698259 2457933 4620706 97200660986648 7466255 9990183 60765953374093 7441773 6851918 59567739236703 4360951 5147843 30543734215896 6931087 8958551 92447144407682 9382485 798996...
output:
No No No No No Yes No No No Yes Yes No No No No No No No No No No Yes No No No Yes No No No No No No No No No No No No No No No No No No No No Yes No No No Yes No No No No No No No No No Yes No No Yes No No No No No No No No No No Yes No No No Yes No No No Yes No No No No No No No No No No No No No ...
result:
ok 100000 tokens
Test #14:
score: 0
Accepted
time: 14ms
memory: 3840kb
input:
100000 461078387 667355286 456090624919430375 23604417 712779052 165726350510651084 847344193 747129143 391621108637132344 423449089 527667332 949130632877632354 688120395 148780459 11178117866347735 934374331 115501564 62664484539924189 420761927 864551062 326392808851216988 558273922 39027397 7738...
output:
No No Yes No Yes No Yes No No Yes No No No No No No No No No No Yes No No No No No Yes No Yes No No No No No No Yes Yes No No No No No No No No No No Yes No No No No No No No No No No No No Yes No No Yes No No No No No No No No No No No No Yes Yes Yes Yes No No Yes No No No No Yes Yes No Yes No No N...
result:
ok 100000 tokens
Test #15:
score: 0
Accepted
time: 3ms
memory: 3968kb
input:
100000 10 9 36 7 10 55 8 5 8 2 9 3 8 3 10 6 1 3 6 7 19 10 1 10 6 7 25 10 9 44 8 9 1 4 7 15 6 5 22 10 7 27 2 5 9 7 2 1 8 3 8 3 10 12 7 8 36 2 9 9 9 4 5 9 7 10 3 2 5 7 4 11 8 7 10 5 2 3 8 7 31 9 8 47 8 3 9 7 2 13 9 10 64 5 1 3 8 9 72 7 6 24 3 7 7 3 4 5 3 7 6 8 3 13 8 3 5 10 3 23 8 5 2 3 8 23 7 10 39 7...
output:
Yes No Yes Yes Yes Yes No Yes No Yes Yes No No No No Yes Yes Yes No Yes Yes Yes No No Yes Yes No Yes Yes No No Yes Yes Yes Yes Yes Yes Yes Yes No Yes No Yes No Yes Yes Yes Yes Yes Yes Yes No No No Yes Yes No Yes No Yes No Yes Yes Yes No Yes Yes No No Yes Yes Yes Yes No No Yes Yes No Yes Yes Yes Yes ...
result:
ok 100000 tokens
Test #16:
score: 0
Accepted
time: 9ms
memory: 3968kb
input:
100000 734 721 373447 803 570 401747 151 173 3701 99 158 14869 223 992 51086 128 675 60043 37 515 6261 920 643 45677 607 246 936 922 153 80153 963 845 593941 525 898 188877 471 734 318944 401 155 55627 416 587 191670 646 835 185325 115 263 19083 526 965 498547 747 968 31272 485 58 15152 939 1000 426...
output:
No No Yes No Yes Yes Yes Yes Yes Yes No Yes No No No No No No Yes No No No Yes No Yes No No No No Yes No Yes No No No No No Yes Yes Yes No No Yes Yes No Yes No Yes Yes Yes Yes Yes Yes Yes Yes No No Yes Yes No Yes No No No No No No Yes Yes No Yes Yes No Yes No No No No No Yes No Yes No Yes Yes No No ...
result:
ok 100000 tokens
Test #17:
score: 0
Accepted
time: 10ms
memory: 3840kb
input:
100000 32231 92266 2770604371 42230 96003 1253951600 80182 12377 827385757 31033 52983 1095808654 62119 12786 635278912 47041 95623 2067395761 31597 62488 1652195503 68149 95382 4407733940 43779 23956 562607488 42079 13667 395168791 74808 71447 4494553094 30403 25937 4720828 23049 52477 1130024512 9...
output:
No Yes No No No No No No Yes No No Yes No Yes Yes No No No No No Yes No Yes No No Yes Yes Yes No No No No No Yes No Yes Yes Yes Yes No Yes No No Yes No No Yes No No No No No No No No Yes Yes No Yes No Yes Yes Yes Yes Yes No No No No No No No Yes Yes No Yes Yes No Yes No Yes No No Yes Yes No No Yes N...
result:
ok 100000 tokens
Test #18:
score: 0
Accepted
time: 11ms
memory: 3968kb
input:
100000 3810923 5708808 14932360854078 5965262 5386583 22172020281391 3844735 7834949 5127417513547 4252291 1624223 3450294524379 2457933 4620706 1312190182588 7466255 9990183 67111186895123 7441773 6851918 16109177647669 4360951 5147843 21136086794083 6931087 8958551 8615586618510 9382485 7989964 42...
output:
Yes No Yes No No No Yes No Yes Yes Yes Yes No No Yes No Yes No No Yes Yes Yes Yes No Yes No No Yes No No No No No No No No Yes Yes No Yes Yes Yes Yes Yes No No No Yes Yes No Yes Yes Yes Yes No No Yes No No Yes No No Yes Yes Yes Yes No Yes Yes Yes Yes No Yes No Yes No No No Yes No No No No Yes Yes Ye...
result:
ok 100000 tokens
Test #19:
score: 0
Accepted
time: 15ms
memory: 3840kb
input:
100000 461078387 667355286 302028648423356735 23604417 712779052 533021022937096 847344193 747129143 161639078989616557 423449089 527667332 22482850933355366 688120395 148780459 25626397068165945 934374331 115501564 19049475390517885 420761927 864551062 272293012993870622 177609799 212880817 1464426...
output:
No Yes Yes Yes Yes No No Yes Yes No No No Yes Yes Yes No Yes No No No Yes Yes No No No Yes Yes No No Yes No Yes Yes Yes No Yes No No No Yes Yes No Yes No Yes Yes Yes No No Yes No No Yes No No Yes Yes No Yes No No Yes No No Yes No No No No Yes No No No No Yes No No Yes No Yes Yes Yes Yes No No No Yes...
result:
ok 100000 tokens
Test #20:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
1 1000000000 1 1000000000000000000
output:
No
result:
ok "No"
Test #21:
score: 0
Accepted
time: 0ms
memory: 3712kb
input:
1 3 1000000000 1000000000000000000
output:
No
result:
ok "No"
Extra Test:
score: 0
Extra Test Passed