QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#76390 | #5466. Permutation Compression | maspy | AC ✓ | 109ms | 14816kb | C++20 | 19.3kb | 2023-02-09 18:30:04 | 2023-02-09 18:30:05 |
Judging History
answer
#line 1 "library/my_template.hpp"
#if defined(LOCAL)
#include <my_template_compiled.hpp>
#else
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using u32 = unsigned int;
using u64 = unsigned long long;
using i128 = __int128;
template <class T>
constexpr T infty = 0;
template <>
constexpr int infty<int> = 1'000'000'000;
template <>
constexpr ll infty<ll> = ll(infty<int>) * infty<int> * 2;
template <>
constexpr u32 infty<u32> = infty<int>;
template <>
constexpr u64 infty<u64> = infty<ll>;
template <>
constexpr i128 infty<i128> = i128(infty<ll>) * infty<ll>;
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 FOR_subset(t, s) \
for (ll t = (s); t >= 0; t = (t == 0 ? -1 : (t - 1) & (s)))
#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); }
// (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, typename U>
T ceil(T x, U y) {
return (x > 0 ? (x + y - 1) / y : x / y);
}
template <typename T, typename U>
T floor(T x, U y) {
return (x > 0 ? x / y : (x - y + 1) / y);
}
template <typename T, typename U>
pair<T, T> divmod(T x, U y) {
T q = floor(x, y);
return {q, x - q * y};
}
template <typename T, typename U>
T SUM(const vector<U> &A) {
T sum = 0;
for (auto &&a: A) sum += a;
return sum;
}
#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) {
assert(!que.empty());
T a = que.top();
que.pop();
return a;
}
template <typename T>
T POP(vc<T> &que) {
assert(!que.empty());
T a = que.back();
que.pop_back();
return a;
}
template <typename F>
ll binary_search(F check, ll ok, ll ng) {
assert(check(ok));
while (abs(ok - ng) > 1) {
auto x = (ng + ok) / 2;
tie(ok, ng) = (check(x) ? mp(x, ng) : mp(ok, 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;
tie(ok, ng) = (check(x) ? mp(x, ng) : mp(ok, 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;
}
#endif
#line 1 "library/other/io.hpp"
// based on yosupo's fastio
#include <unistd.h>
namespace fastio {
#define FASTIO
// クラスが read(), print() を持っているかを判定するメタ関数
struct has_write_impl {
template <class T>
static auto check(T &&x) -> decltype(x.write(), std::true_type{});
template <class T>
static auto check(...) -> std::false_type;
};
template <class T>
class has_write : public decltype(has_write_impl::check<T>(std::declval<T>())) {
};
struct has_read_impl {
template <class T>
static auto check(T &&x) -> decltype(x.read(), std::true_type{});
template <class T>
static auto check(...) -> std::false_type;
};
template <class T>
class has_read : public decltype(has_read_impl::check<T>(std::declval<T>())) {};
struct Scanner {
FILE *fp;
char line[(1 << 15) + 1];
size_t st = 0, ed = 0;
void reread() {
memmove(line, line + st, ed - st);
ed -= st;
st = 0;
ed += fread(line + ed, 1, (1 << 15) - ed, fp);
line[ed] = '\0';
}
bool succ() {
while (true) {
if (st == ed) {
reread();
if (st == ed) return false;
}
while (st != ed && isspace(line[st])) st++;
if (st != ed) break;
}
if (ed - st <= 50) {
bool sep = false;
for (size_t i = st; i < ed; i++) {
if (isspace(line[i])) {
sep = true;
break;
}
}
if (!sep) reread();
}
return true;
}
template <class T, enable_if_t<is_same<T, string>::value, int> = 0>
bool read_single(T &ref) {
if (!succ()) return false;
while (true) {
size_t sz = 0;
while (st + sz < ed && !isspace(line[st + sz])) sz++;
ref.append(line + st, sz);
st += sz;
if (!sz || st != ed) break;
reread();
}
return true;
}
template <class T, enable_if_t<is_integral<T>::value, int> = 0>
bool read_single(T &ref) {
if (!succ()) return false;
bool neg = false;
if (line[st] == '-') {
neg = true;
st++;
}
ref = T(0);
while (isdigit(line[st])) { ref = 10 * ref + (line[st++] & 0xf); }
if (neg) ref = -ref;
return true;
}
template <typename T,
typename enable_if<has_read<T>::value>::type * = nullptr>
inline bool read_single(T &x) {
x.read();
return true;
}
bool read_single(double &ref) {
string s;
if (!read_single(s)) return false;
ref = std::stod(s);
return true;
}
bool read_single(char &ref) {
string s;
if (!read_single(s) || s.size() != 1) return false;
ref = s[0];
return true;
}
template <class T>
bool read_single(vector<T> &ref) {
for (auto &d: ref) {
if (!read_single(d)) return false;
}
return true;
}
template <class T, class U>
bool read_single(pair<T, U> &p) {
return (read_single(p.first) && read_single(p.second));
}
template <size_t N = 0, typename T>
void read_single_tuple(T &t) {
if constexpr (N < std::tuple_size<T>::value) {
auto &x = std::get<N>(t);
read_single(x);
read_single_tuple<N + 1>(t);
}
}
template <class... T>
bool read_single(tuple<T...> &tpl) {
read_single_tuple(tpl);
return true;
}
void read() {}
template <class H, class... T>
void read(H &h, T &... t) {
bool f = read_single(h);
assert(f);
read(t...);
}
Scanner(FILE *fp) : fp(fp) {}
};
struct Printer {
Printer(FILE *_fp) : fp(_fp) {}
~Printer() { flush(); }
static constexpr size_t SIZE = 1 << 15;
FILE *fp;
char line[SIZE], small[50];
size_t pos = 0;
void flush() {
fwrite(line, 1, pos, fp);
pos = 0;
}
void write(const char val) {
if (pos == SIZE) flush();
line[pos++] = val;
}
template <class T, enable_if_t<is_integral<T>::value, int> = 0>
void write(T val) {
if (pos > (1 << 15) - 50) flush();
if (val == 0) {
write('0');
return;
}
if (val < 0) {
write('-');
val = -val; // todo min
}
size_t len = 0;
while (val) {
small[len++] = char(0x30 | (val % 10));
val /= 10;
}
for (size_t i = 0; i < len; i++) { line[pos + i] = small[len - 1 - i]; }
pos += len;
}
void write(const string s) {
for (char c: s) write(c);
}
void write(const char *s) {
size_t len = strlen(s);
for (size_t i = 0; i < len; i++) write(s[i]);
}
void write(const double x) {
ostringstream oss;
oss << fixed << setprecision(15) << x;
string s = oss.str();
write(s);
}
void write(const long double x) {
ostringstream oss;
oss << fixed << setprecision(15) << x;
string s = oss.str();
write(s);
}
template <typename T,
typename enable_if<has_write<T>::value>::type * = nullptr>
inline void write(T x) {
x.write();
}
template <class T>
void write(const vector<T> val) {
auto n = val.size();
for (size_t i = 0; i < n; i++) {
if (i) write(' ');
write(val[i]);
}
}
template <class T, class U>
void write(const pair<T, U> val) {
write(val.first);
write(' ');
write(val.second);
}
template <size_t N = 0, typename T>
void write_tuple(const T t) {
if constexpr (N < std::tuple_size<T>::value) {
if constexpr (N > 0) { write(' '); }
const auto x = std::get<N>(t);
write(x);
write_tuple<N + 1>(t);
}
}
template <class... T>
bool write(tuple<T...> tpl) {
write_tuple(tpl);
return true;
}
template <class T, size_t S>
void write(const array<T, S> val) {
auto n = val.size();
for (size_t i = 0; i < n; i++) {
if (i) write(' ');
write(val[i]);
}
}
void write(i128 val) {
string s;
bool negative = 0;
if (val < 0) {
negative = 1;
val = -val;
}
while (val) {
s += '0' + int(val % 10);
val /= 10;
}
if (negative) s += "-";
reverse(all(s));
if (len(s) == 0) s = "0";
write(s);
}
};
Scanner scanner = Scanner(stdin);
Printer printer = Printer(stdout);
void flush() { printer.flush(); }
void print() { printer.write('\n'); }
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
printer.write(head);
if (sizeof...(Tail)) printer.write(' ');
print(forward<Tail>(tail)...);
}
void read() {}
template <class Head, class... Tail>
void read(Head &head, Tail &... tail) {
scanner.read(head);
read(tail...);
}
} // namespace fastio
using fastio::print;
using fastio::flush;
using fastio::read;
#define INT(...) \
int __VA_ARGS__; \
read(__VA_ARGS__)
#define LL(...) \
ll __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); }
#line 1 "library/ds/fastset.hpp"
/* 64分木。
insert, erase
[]での存在判定
next, prev
*/
struct FastSet {
using uint = unsigned;
using ull = unsigned long long;
int bsr(ull x) { return 63 - __builtin_clzll(x); }
int bsf(ull x) { return __builtin_ctzll(x); }
static constexpr uint B = 64;
int n, lg;
vector<vector<ull>> seg;
FastSet(int _n) : n(_n) {
do {
seg.push_back(vector<ull>((_n + B - 1) / B));
_n = (_n + B - 1) / B;
} while (_n > 1);
lg = int(seg.size());
}
bool operator[](int i) const { return (seg[0][i / B] >> (i % B) & 1) != 0; }
void insert(int i) {
for (int h = 0; h < lg; h++) {
seg[h][i / B] |= 1ULL << (i % B);
i /= B;
}
}
void erase(int i) {
for (int h = 0; h < lg; h++) {
seg[h][i / B] &= ~(1ULL << (i % B));
if (seg[h][i / B]) break;
i /= B;
}
}
// x以上最小の要素を返す。存在しなければ n。
int next(int i) {
chmax(i, 0);
if (i >= n) return n;
for (int h = 0; h < lg; h++) {
if (i / B == seg[h].size()) break;
ull d = seg[h][i / B] >> (i % B);
if (!d) {
i = i / B + 1;
continue;
}
// find
i += bsf(d);
for (int g = h - 1; g >= 0; g--) {
i *= B;
i += bsf(seg[g][i / B]);
}
return i;
}
return n;
}
// x以下最大の要素を返す。存在しなければ -1。
int prev(int i) {
if (i < 0) return -1;
if (i >= n) i = n - 1;
for (int h = 0; h < lg; h++) {
if (i == -1) break;
ull d = seg[h][i / B] << (63 - i % 64);
if (!d) {
i = i / B - 1;
continue;
}
// find
i += bsr(d) - (B - 1);
for (int g = h - 1; g >= 0; g--) {
i *= B;
i += bsr(seg[g][i / B]);
}
return i;
}
return -1;
}
// [l, r) 内の要素を全部集める
vector<int> collect(int l, int r) {
vector<int> res;
int x = l - 1;
while (1) {
x = next(x + 1);
if (x >= r) break;
res.emplace_back(x);
}
return res;
}
void debug() {
string s;
for (int i = 0; i < n; ++i) s += ((*this)[i] ? '1' : '0');
print(s);
}
};
#line 2 "library/alg/monoid/add.hpp"
template <typename X>
struct Monoid_Add {
using value_type = X;
static constexpr X op(const X &x, const X &y) noexcept { return x + y; }
static constexpr X inverse(const X &x) noexcept { return -x; }
static constexpr X power(const X &x, ll n) noexcept { return X(n) * x; }
static constexpr X unit() { return X(0); }
static constexpr bool commute = true;
};
#line 3 "library/ds/fenwicktree/fenwicktree.hpp"
template <typename Monoid>
struct FenwickTree {
using G = Monoid;
using E = typename G::value_type;
int n;
vector<E> dat;
E total;
FenwickTree() {}
FenwickTree(int n) { build(n); }
template <typename F>
FenwickTree(int n, F f) {
build(n, f);
}
FenwickTree(const vc<E>& v) { build(v); }
void build(int m) {
n = m;
dat.assign(m, G::unit());
total = G::unit();
}
void build(const vc<E>& v) {
build(len(v), [&](int i) -> E { return v[i]; });
}
template <typename F>
void build(int m, F f) {
n = m;
dat.clear();
dat.reserve(n);
total = G::unit();
FOR(i, n) { dat.eb(f(i)); }
for (int i = 1; i <= n; ++i) {
int j = i + (i & -i);
if (j <= n) dat[j - 1] = G::op(dat[i - 1], dat[j - 1]);
}
total = prefix_sum(m);
}
E prod_all() { return total; }
E sum_all() { return total; }
E sum(int k) { return prefix_sum(k); }
E prod(int k) { return prefix_prod(k); }
E prefix_sum(int k) { return prefix_prod(k); }
E prefix_prod(int k) {
chmin(k, n);
E ret = G::unit();
for (; k > 0; k -= k & -k) ret = G::op(ret, dat[k - 1]);
return ret;
}
E sum(int L, int R) { return prod(L, R); }
E prod(int L, int R) {
chmax(L, 0), chmin(R, n);
if (L == 0) return prefix_prod(R);
assert(0 <= L && L <= R && R <= n);
E pos = G::unit(), neg = G::unit();
while (L < R) { pos = G::op(pos, dat[R - 1]), R -= R & -R; }
while (R < L) { neg = G::op(neg, dat[L - 1]), L -= L & -L; }
return G::op(pos, G::inverse(neg));
}
void add(int k, E x) { multiply(k, x); }
void multiply(int k, E x) {
static_assert(G::commute);
total = G::op(total, x);
for (++k; k <= n; k += k & -k) dat[k - 1] = G::op(dat[k - 1], x);
}
template <class F>
int max_right(const F check) {
assert(check(G::unit()));
int i = 0;
E s = G::unit();
int k = 1;
while (2 * k <= n) k *= 2;
while (k) {
if (i + k - 1 < len(dat)) {
E t = G::op(s, dat[i + k - 1]);
if (check(t)) { i += k, s = t; }
}
k >>= 1;
}
return i;
}
int kth(E k) {
return max_right([&k](E x) -> bool { return x <= k; });
}
};
#line 5 "main.cpp"
void solve() {
LL(N, M, K);
VEC(int, A, N);
for (auto&& x: A) --x;
VEC(int, B, M);
for (auto&& x: B) --x;
vc<bool> use(N);
for (auto&& x: B) { use[x] = 1; }
FenwickTree<Monoid_Add<int>> bit(N, [&](int i) -> int { return 1; });
multiset<int> S;
FOR(K) {
LL(L);
S.insert(L);
}
vc<int> pos(N);
FOR(i, N) pos[A[i]] = i;
FastSet NG(N);
{
vc<int> C;
for (auto&& x: A)
if (use[x]) C.eb(x);
if (B != C) return NO();
}
FOR_R(x, N) {
int me = pos[x];
if (!use[x]) {
int a = NG.prev(me - 1) + 1;
int b = NG.next(me + 1) - 1;
int s = bit.sum(a, b + 1);
// 大きさ s 以下の要素を使って
auto it = S.upper_bound(s);
if (it == S.begin()) return NO();
--it;
S.erase(it);
bit.add(me, -1);
} else {
NG.insert(me);
bit.add(me, -1);
}
}
YES();
}
signed main() {
INT(T);
FOR(T) solve();
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3296kb
input:
3 5 2 3 5 1 3 2 4 5 2 1 2 4 5 5 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 3 2 2 3 1 2 3 2 2 3
output:
YES YES NO
result:
ok 3 lines
Test #2:
score: 0
Accepted
time: 2ms
memory: 3444kb
input:
100 2 1 2 2 1 2 1 1 2 1 2 1 2 1 2 2 2 1 1 1 2 1 2 6 1 5 3 4 2 5 6 1 3 5 2 1 1 1 6 1 6 2 1 3 6 4 5 1 4 1 2 2 1 4 3 3 2 2 1 3 2 1 3 2 2 1 1 1 1 1 1 1 1 1 1 1 1 2 1 2 2 1 2 1 2 4 4 3 2 1 3 4 2 1 3 4 4 3 1 1 1 1 1 1 1 6 5 1 6 2 5 4 3 1 6 2 4 3 1 4 1 1 1 1 1 1 6 5 3 3 6 1 4 5 2 3 6 1 4 2 3 3 4 4 3 4 3 4 ...
output:
YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES YES NO YES YES YES YES YES YES YES YES YES YES NO NO NO YES YES NO NO YES YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES YES YES YES NO YES YES YES YES YES YES YES NO YES YES YES YES YE...
result:
ok 100 lines
Test #3:
score: 0
Accepted
time: 2ms
memory: 3288kb
input:
99 6 1 6 1 5 3 4 2 6 1 1 2 1 1 1 6 1 1 1 1 1 1 4 1 3 3 4 1 2 1 1 1 2 2 2 1 2 1 2 1 2 1 1 1 1 1 1 2 1 2 1 2 2 1 2 1 1 1 1 1 1 1 1 1 1 1 1 3 2 2 3 2 1 2 1 1 2 3 3 1 2 3 1 2 3 1 1 6 1 5 3 4 2 5 6 1 3 4 2 1 1 1 6 4 4 1 6 5 2 3 4 1 2 3 4 5 4 4 6 2 1 1 1 2 1 1 6 5 1 2 1 4 5 6 3 2 1 4 6 3 2 6 3 6 5 6 2 1 3...
output:
YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO NO YES YES YES YES YES YES YES YES YES NO YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES YES YES YES YES NO NO YES YES YES NO YES YES YES NO YES YES NO YES NO YES NO YES YES YES YES YES YES NO YES NO NO YES YES YES YE...
result:
ok 99 lines
Test #4:
score: 0
Accepted
time: 2ms
memory: 3440kb
input:
98 6 1 6 6 1 4 5 2 3 3 1 2 2 1 1 6 4 3 2 2 3 4 1 2 1 3 3 4 1 1 1 1 1 1 6 1 6 6 4 3 1 2 5 1 3 1 3 1 1 5 1 1 1 1 1 1 6 4 4 3 4 1 2 5 6 3 4 1 2 2 4 3 1 6 5 1 4 5 3 6 1 2 4 5 3 1 2 6 1 1 1 1 1 1 5 1 4 1 3 2 4 5 1 5 3 4 4 6 3 4 1 4 2 3 6 5 1 2 5 5 4 6 5 4 1 3 2 1 4 3 2 1 1 1 1 1 1 1 1 1 6 3 5 5 1 3 6 4 2...
output:
YES NO YES YES YES YES YES YES NO NO YES YES NO YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES NO YES YES YES NO YES YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES YES NO YES YES YES YES YES NO YES NO YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES NO Y...
result:
ok 98 lines
Test #5:
score: 0
Accepted
time: 18ms
memory: 3256kb
input:
60000 1 1 1 1 1 1 1 1 1 1 1 1 3 2 1 2 3 1 2 1 2 3 3 1 1 2 3 1 2 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 2 3 2 1 3 2 1 1 1 2 2 1 2 1 2 1 1 1 1 1 1 1 1 2 2 1 1 2 1 2 1 1 1 1 1 1 1 3 1 3 2 3 1 1 2 3 2 3 3 2 2 3 1 2 3 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 3 2 3 3 2 1 2 1 1 2 1 3 2 2 1 3 2 3 2 3 ...
output:
YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES YES YES YES NO YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO 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 60000 lines
Test #6:
score: 0
Accepted
time: 16ms
memory: 3396kb
input:
50000 1 1 1 1 1 1 4 3 4 1 2 3 4 1 2 3 2 3 4 4 1 1 1 1 1 1 3 2 1 3 1 2 1 2 3 4 1 4 2 1 4 3 2 4 4 3 4 3 1 2 1 2 3 2 3 3 4 1 3 4 2 1 3 1 3 2 4 4 4 2 4 1 2 3 4 1 2 3 3 4 3 1 2 2 1 3 3 1 3 4 2 2 4 3 1 2 3 1 2 1 1 1 1 1 1 1 4 3 1 1 2 3 4 1 2 4 4 4 1 4 4 3 2 1 4 2 1 1 2 3 3 1 2 1 3 2 1 3 1 4 3 2 1 3 2 4 1 ...
output:
YES YES YES YES NO NO YES YES NO YES YES NO YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES NO YES YES YES YES YES YES YES YES NO YES YES YES YES YES YES NO YES YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES Y...
result:
ok 50000 lines
Test #7:
score: 0
Accepted
time: 25ms
memory: 3348kb
input:
40000 3 2 1 3 2 1 2 1 3 5 5 1 5 2 1 3 4 5 2 1 3 4 5 4 1 3 1 4 3 2 1 1 1 1 5 3 3 5 3 4 1 2 3 1 2 1 2 1 3 1 2 1 3 2 1 3 1 2 2 2 1 2 1 2 2 2 5 4 2 5 4 2 1 3 4 2 1 3 1 2 1 1 1 1 1 1 3 1 2 1 2 3 1 2 1 2 1 1 1 2 1 2 5 5 2 5 2 3 1 4 5 2 3 1 4 1 1 5 3 4 4 5 1 2 3 4 2 3 1 1 1 3 1 1 1 1 1 1 5 4 2 2 1 4 5 3 2 ...
output:
YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES NO YES YES YES YES YES YES YES NO NO YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES NO YES YES YES YES YES YES YES YES YES NO YES YES YES NO YES NO YES YES NO YES YES YES YES YES NO NO YES YES YES YES ...
result:
ok 40000 lines
Test #8:
score: 0
Accepted
time: 31ms
memory: 3308kb
input:
40000 6 3 5 3 6 2 5 1 4 3 2 1 1 2 3 6 1 4 3 1 1 3 4 2 1 3 2 1 1 1 1 1 1 1 1 1 1 1 1 1 6 2 6 4 1 3 2 6 5 2 5 6 5 5 3 5 5 6 6 2 3 6 2 5 1 4 3 6 2 5 1 4 6 4 2 2 1 1 2 1 2 2 2 2 1 1 2 1 2 1 3 3 3 2 1 3 2 1 3 2 3 1 6 4 5 5 1 3 4 6 2 5 1 3 2 5 5 4 3 4 6 2 4 4 3 5 6 2 1 4 3 2 2 1 1 3 1 2 2 3 1 1 2 2 3 3 1 ...
output:
YES YES YES YES NO YES YES YES YES YES YES YES YES YES NO YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES NO YES YES YES YES YES YES YES YES YE...
result:
ok 40000 lines
Test #9:
score: 0
Accepted
time: 25ms
memory: 3392kb
input:
40000 7 5 2 6 4 2 1 3 5 7 6 4 2 1 3 3 1 2 2 2 2 1 2 1 1 1 4 1 4 3 4 2 1 1 3 4 2 1 3 2 2 1 3 2 1 2 1 3 5 2 4 4 3 2 5 1 2 1 2 2 2 5 7 1 7 2 7 5 6 1 4 3 3 3 3 1 1 3 1 6 7 7 2 3 7 2 5 1 6 4 3 7 2 5 1 6 4 5 6 6 2 6 2 6 3 4 1 5 2 1 6 3 4 5 3 5 3 1 3 3 1 2 1 2 3 3 7 5 3 1 7 5 4 6 3 2 5 4 6 3 2 6 1 1 6 3 5 ...
output:
YES YES YES YES YES YES YES YES YES YES YES YES YES NO NO YES YES NO YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES YES YES YES NO YES YES NO YES YES YES YES YES YES YES NO YES YES YES NO YES YES YES YES YES YES YES YES NO YES YES YES YES YES NO YES YES NO YES YES NO YES YES ...
result:
ok 40000 lines
Test #10:
score: 0
Accepted
time: 23ms
memory: 3312kb
input:
40000 4 2 4 4 1 3 2 4 2 3 4 4 3 6 3 5 6 2 4 5 1 3 2 1 3 1 1 2 6 1 8 5 6 1 7 2 8 6 5 3 4 1 7 5 2 3 3 1 2 8 7 8 6 6 1 3 4 6 1 5 2 3 4 6 1 5 2 6 8 7 2 6 8 5 7 1 3 2 4 6 5 7 1 3 2 4 8 7 1 1 1 1 1 1 4 3 3 2 4 3 1 2 4 3 1 2 4 4 3 3 1 3 4 2 1 3 2 4 4 3 2 2 1 1 2 1 2 2 7 5 3 5 2 3 7 1 6 4 2 3 1 6 4 7 5 6 7 ...
output:
NO YES NO YES YES YES YES YES YES NO YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES YES YES YES YES YES YES NO YES NO YES YES YES YES YES YES YES NO YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES YES NO YES YES YES YES YES YES YES YES YES YES NO YES NO...
result:
ok 40000 lines
Test #11:
score: 0
Accepted
time: 32ms
memory: 3424kb
input:
40000 2 2 2 1 2 1 2 1 1 8 2 6 1 3 5 4 6 7 2 8 3 2 2 8 6 8 7 8 8 5 4 3 1 2 7 8 5 4 6 3 1 2 5 4 8 7 7 7 1 1 1 1 1 1 1 1 1 1 1 1 2 1 1 1 2 2 2 2 2 2 1 2 2 1 2 2 2 2 2 2 1 2 1 2 1 8 1 7 5 3 8 4 1 7 6 2 2 3 5 2 1 1 1 1 9 8 2 7 8 1 6 4 5 9 3 2 7 8 1 6 4 5 3 2 2 9 2 1 2 2 1 2 1 1 4 1 4 3 1 4 2 3 1 2 1 2 3 ...
output:
YES NO NO YES YES NO NO YES YES YES YES YES YES YES YES NO YES NO YES YES YES YES NO YES YES YES NO YES NO NO NO YES YES NO YES YES YES YES NO YES NO YES YES YES YES YES YES YES YES YES NO YES NO YES YES YES YES YES YES YES YES NO YES YES YES NO YES YES YES YES YES YES YES YES YES YES YES NO YES YES...
result:
ok 40000 lines
Test #12:
score: 0
Accepted
time: 37ms
memory: 3264kb
input:
40000 1 1 1 1 1 1 7 5 4 7 4 6 2 5 1 3 7 4 6 2 1 1 2 3 7 7 4 3 7 4 1 3 2 5 6 1 3 2 5 6 5 7 7 1 6 5 4 3 1 7 2 6 6 4 2 3 1 1 1 4 3 4 2 4 3 1 2 3 1 2 3 3 3 3 1 3 3 1 2 2 1 3 3 1 1 1 1 1 1 2 1 1 1 2 1 2 9 2 8 9 8 6 4 2 1 5 7 3 4 1 1 2 2 3 5 4 2 9 1 1 1 1 1 1 4 2 3 2 4 3 1 2 1 3 2 4 3 3 3 1 3 2 1 3 2 3 3 ...
output:
YES YES NO YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES NO NO YES YES NO YES YES YES YES NO NO YES YES YES YES YES YES YES YES YES NO YES NO NO NO YES NO YES YES YES NO YES YES YES YES YES NO NO YES YES YES YES YES YES YES YES NO YES NO YES YES YES NO YES YES YES YES YE...
result:
ok 40000 lines
Test #13:
score: 0
Accepted
time: 41ms
memory: 3308kb
input:
40000 6 3 5 4 3 2 5 1 6 2 3 1 2 1 1 6 6 2 1 1 1 2 1 1 6 5 4 1 3 5 6 2 4 1 3 6 2 4 2 2 6 6 8 2 7 5 8 4 7 1 3 2 6 6 2 1 3 1 1 1 1 7 1 1 1 1 1 1 11 6 5 2 4 11 6 9 3 8 1 7 5 10 2 4 3 6 8 5 3 1 4 1 1 8 3 8 6 4 8 5 1 3 7 2 4 1 2 2 2 1 3 3 4 8 4 2 1 2 2 1 1 2 2 5 5 1 1 5 3 4 2 1 5 3 4 2 5 9 2 9 8 7 5 6 2 4...
output:
NO YES YES NO YES NO YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES YES YES NO YES YES YES YES NO YES NO NO YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES YES NO YES YES NO YES NO YES YES YES YES YES YES NO YES YES YES YES YES YES NO NO YES NO YES YES YES YES...
result:
ok 40000 lines
Test #14:
score: 0
Accepted
time: 35ms
memory: 3392kb
input:
40000 5 4 3 1 5 4 2 3 1 4 2 3 1 5 4 12 1 12 8 11 5 1 7 3 10 6 4 9 12 2 4 3 6 2 1 1 2 9 11 12 10 11 12 2 2 1 2 1 2 1 2 4 3 4 2 3 4 1 2 3 1 2 2 1 3 2 2 1 2 1 2 1 2 6 4 5 2 5 3 4 1 6 2 3 1 6 3 6 6 3 6 4 4 1 3 4 1 2 3 4 1 2 2 3 1 2 3 2 1 1 3 3 11 8 4 11 3 10 5 1 6 4 8 7 9 2 11 3 1 6 4 7 9 2 10 8 11 10 1...
output:
YES NO YES YES YES YES YES NO NO YES YES YES YES YES YES NO YES YES YES YES YES YES YES YES YES YES YES YES NO YES YES YES YES YES YES YES YES YES YES NO YES YES NO YES YES YES YES NO YES YES NO YES YES YES YES NO YES YES YES YES NO YES YES YES YES YES NO YES NO YES YES YES YES YES YES YES NO YES YE...
result:
ok 40000 lines
Test #15:
score: 0
Accepted
time: 15ms
memory: 3344kb
input:
10000 10 5 6 5 6 9 10 7 1 3 2 4 8 5 6 9 1 2 8 9 9 10 10 10 10 6 5 5 6 7 2 4 8 10 9 1 3 5 2 8 9 1 3 9 7 7 10 10 5 3 4 3 5 4 1 2 4 1 2 3 5 4 5 6 3 5 6 1 2 5 4 3 1 4 3 4 5 5 5 4 10 8 5 7 3 1 5 9 8 2 6 10 4 3 1 5 9 8 2 6 4 6 1 4 8 10 10 6 4 7 1 4 5 8 9 3 10 2 6 1 4 8 3 2 6 2 1 2 1 10 3 10 9 6 4 7 2 5 8 ...
output:
NO NO NO NO YES YES NO YES YES YES NO NO YES YES YES NO NO YES YES YES YES NO YES YES NO YES YES YES YES YES YES YES YES YES NO YES YES YES NO YES YES YES NO YES YES NO YES YES YES YES NO NO YES YES YES NO NO NO YES YES YES YES YES YES NO YES YES NO YES YES YES NO YES NO NO NO YES YES NO YES YES YES...
result:
ok 10000 lines
Test #16:
score: 0
Accepted
time: 19ms
memory: 3312kb
input:
10000 15 15 1 15 6 5 8 3 2 12 9 10 1 4 7 14 11 13 15 6 5 8 3 2 12 9 10 1 4 7 14 11 13 10 8 3 6 5 6 2 4 1 3 8 7 6 1 7 7 7 8 8 8 7 19 1 19 7 10 13 3 5 16 12 17 19 8 1 2 11 18 6 14 9 15 4 1 4 8 1 1 5 1 1 3 2 5 2 2 1 17 18 18 18 17 18 20 11 12 5 14 20 19 1 10 8 3 13 15 4 2 16 18 7 6 17 9 11 12 5 14 10 8...
output:
YES NO NO NO YES YES YES YES NO NO NO NO YES NO NO NO NO YES NO YES NO NO YES YES YES NO NO NO YES NO NO NO YES YES YES YES YES YES YES NO YES YES YES NO YES NO YES YES YES YES NO NO YES YES YES NO YES NO YES YES YES YES YES YES YES NO YES YES YES NO NO NO NO NO YES NO NO YES YES YES NO NO YES YES Y...
result:
ok 10000 lines
Test #17:
score: 0
Accepted
time: 29ms
memory: 3420kb
input:
10000 4 3 4 1 4 3 2 1 3 2 2 4 3 4 1 1 1 1 1 1 79 70 9 73 34 21 66 52 46 72 32 63 44 48 11 77 40 15 51 50 67 70 53 62 3 31 69 20 41 28 30 54 10 7 19 24 74 5 4 59 1 18 37 68 25 23 58 6 33 65 55 43 39 17 12 49 35 56 8 75 64 45 14 36 22 13 57 60 27 71 61 42 9 76 2 16 79 78 26 38 47 29 73 34 21 66 52 46 ...
output:
YES YES YES NO YES NO YES YES YES NO YES NO NO YES YES YES YES NO YES NO NO YES YES YES NO NO YES NO YES YES YES YES YES YES YES YES NO NO YES NO YES NO YES NO YES YES YES YES YES NO YES YES NO NO YES NO YES NO YES NO NO NO YES YES YES YES YES NO YES NO NO YES YES YES YES YES YES YES YES YES NO YES ...
result:
ok 10000 lines
Test #18:
score: 0
Accepted
time: 30ms
memory: 5064kb
input:
10 10201 2518 7686 8039 7511 4669 4613 6162 1290 9288 8391 4993 2070 8427 2499 3018 4916 4911 6060 8440 8901 8250 8997 3347 142 4313 3070 4228 9879 9075 2665 5642 762 2855 9465 1799 10036 6353 2529 8827 686 3883 6577 1430 5052 8277 6025 3863 8054 2652 618 8088 8364 3502 7890 391 9096 8691 919 6628 5...
output:
NO NO YES YES YES NO YES NO YES NO
result:
ok 10 lines
Test #19:
score: 0
Accepted
time: 30ms
memory: 5012kb
input:
20 3517 1806 1714 2427 3145 194 284 2676 2141 2910 1618 2873 1968 40 243 1537 1591 1601 2415 4 3510 2693 406 2190 1132 2469 2613 1250 779 922 1718 1695 2492 993 1755 401 2836 852 3047 2043 3222 894 2147 694 648 3231 3218 1357 1075 1493 2303 9 1948 2212 2702 1547 2074 2697 158 686 3377 580 561 3256 2...
output:
NO NO NO NO YES YES YES YES NO YES YES YES YES NO NO NO NO NO YES NO
result:
ok 20 lines
Test #20:
score: 0
Accepted
time: 22ms
memory: 3928kb
input:
30 15323 12316 3009 5461 8905 8847 12520 7056 5196 2078 6413 10193 12294 4601 3990 3691 6826 1631 4736 1507 5339 9776 3413 3135 4489 6794 9471 862 9813 7867 1310 6835 13073 14303 6260 7845 1433 619 4653 10981 8986 4105 5834 14974 7877 11174 14863 3485 4000 5318 3431 9158 14662 4199 13232 11276 6580 ...
output:
YES NO YES NO NO NO YES NO NO NO NO YES YES YES NO YES YES NO YES NO YES NO YES NO YES NO YES NO NO YES
result:
ok 30 lines
Test #21:
score: 0
Accepted
time: 65ms
memory: 9632kb
input:
3 123075 23064 100012 93912 55885 25582 39571 6971 36425 111197 79711 41681 36088 693 117681 100171 12244 42071 77370 19600 53711 112897 110126 115034 42792 46276 8459 72493 52952 122924 83906 367 41855 74275 99613 118996 21890 122972 36973 76603 40716 7063 79518 4540 39960 38554 55233 19544 92392 3...
output:
NO YES NO
result:
ok 3 lines
Test #22:
score: 0
Accepted
time: 61ms
memory: 8572kb
input:
4 31527 2796 28734 1091 15861 5182 25030 27184 384 25626 7875 22836 23990 4973 27139 12878 30083 11749 20745 3399 19106 29421 12483 20464 30788 19048 29417 24523 22999 25196 28530 27888 26709 3478 19015 24185 887 1969 2215 24685 15962 18456 23338 18736 4527 22655 4687 23060 11863 4901 3527 7811 2283...
output:
NO NO YES NO
result:
ok 4 lines
Test #23:
score: 0
Accepted
time: 60ms
memory: 10152kb
input:
5 128749 17051 111701 42741 35862 99499 45249 15779 49403 94479 13369 26628 74005 104652 61098 74718 101311 121179 35971 17170 127737 44876 86156 37900 121074 59776 8186 33056 70308 47231 103130 46819 30793 92983 64947 81070 22509 81368 63589 93078 4151 100180 73376 98264 107502 11904 38860 21961 10...
output:
YES NO YES NO NO
result:
ok 5 lines
Test #24:
score: 0
Accepted
time: 66ms
memory: 12676kb
input:
1 200000 57269 142732 56485 21830 54745 11490 20478 59868 167162 157180 123880 143389 44431 140207 54973 40039 150219 159643 85985 14685 3473 102446 6810 92845 180268 114911 137969 132109 128664 108792 186933 55472 195896 115087 15917 105577 65383 70698 113367 65049 2997 160394 11175 198245 185075 1...
output:
YES
result:
ok single line: 'YES'
Test #25:
score: 0
Accepted
time: 45ms
memory: 10240kb
input:
1 199999 120008 79991 11524 59564 34585 129380 105753 63181 176751 119041 169055 186005 190477 79671 1720 193902 143991 198305 69536 183827 3714 110965 179278 149649 71533 182722 75184 138062 181285 93178 86162 133827 125972 129063 45913 64540 162821 124187 36375 64939 134935 148193 102682 100111 18...
output:
NO
result:
ok single line: 'NO'
Test #26:
score: 0
Accepted
time: 91ms
memory: 14440kb
input:
1 199998 12889 187112 54885 81539 162891 84489 130233 4096 3799 9829 21054 167111 154545 36547 37796 75620 65489 157435 113420 89616 184076 35797 127006 198125 41743 86532 149556 96068 39239 89854 33860 4724 12003 189987 173261 172025 164487 73735 89862 144539 3988 130032 129552 179986 14001 24747 1...
output:
YES
result:
ok single line: 'YES'
Test #27:
score: 0
Accepted
time: 17ms
memory: 9196kb
input:
1 199997 153139 46858 183204 93470 24352 15732 37436 10974 170128 170089 74009 79847 56162 103302 17084 154007 75065 171213 1153 148087 50102 51955 177246 20666 4212 51145 165520 56719 7671 163117 78613 110765 154097 170382 104314 48488 108419 9810 185722 163443 135931 190348 42275 199252 180289 245...
output:
YES
result:
ok single line: 'YES'
Test #28:
score: 0
Accepted
time: 61ms
memory: 11684kb
input:
1 199996 86158 113838 81446 101407 142912 106775 22395 111854 111586 41927 13570 92769 33003 48836 161914 196696 45540 99175 124555 52273 110429 53625 102678 53933 195706 23936 163148 86968 18878 175728 19332 160549 104907 24741 2395 195686 170166 110638 9285 25328 23058 5167 104793 137648 149623 10...
output:
NO
result:
ok single line: 'NO'
Test #29:
score: 0
Accepted
time: 53ms
memory: 12548kb
input:
1 199995 66973 133022 141540 128289 167404 140394 4021 105225 90743 154484 126214 160784 83736 150642 296 68317 114500 67405 158794 37791 141 74145 58490 56256 25698 17061 133675 81700 187523 110730 78879 95692 149275 9442 13255 146084 155698 72731 126211 156427 16459 93208 43627 60181 101903 2339 2...
output:
NO
result:
ok single line: 'NO'
Test #30:
score: 0
Accepted
time: 37ms
memory: 11308kb
input:
1 199994 97123 102871 140014 28957 186661 19712 169590 65843 86042 4144 116297 132483 195845 145682 86370 122119 173093 117347 78762 85412 60300 62993 137507 165076 71161 58577 176802 144149 24309 101925 33453 39706 21387 79174 173927 194133 83446 88159 13 92186 174668 31779 141573 111747 2989 74690...
output:
YES
result:
ok single line: 'YES'
Test #31:
score: 0
Accepted
time: 55ms
memory: 11048kb
input:
1 199993 101458 98535 11612 139662 116573 168331 48474 76673 80313 135138 155730 73720 59045 199095 64703 168675 164136 23826 100378 164306 138852 7422 24299 110739 111786 147737 152865 107362 67755 116328 47436 131074 169135 140764 76351 146587 124128 106612 18428 168845 44079 31449 38004 18208 797...
output:
YES
result:
ok single line: 'YES'
Test #32:
score: 0
Accepted
time: 54ms
memory: 12300kb
input:
1 199992 73979 126014 35909 21472 152208 54748 186757 108976 87082 101782 136679 177796 197065 140053 75254 62673 107111 176089 142370 66404 17342 37124 165483 41098 167771 171447 30539 156680 14270 89595 56092 121834 98304 112092 16376 69358 70793 131338 190023 94738 33227 154099 171946 182215 1678...
output:
NO
result:
ok single line: 'NO'
Test #33:
score: 0
Accepted
time: 89ms
memory: 13884kb
input:
1 199991 24343 175649 153553 142394 186662 67981 195345 174639 23591 85769 5322 167939 73334 120872 184252 88372 51941 50879 47503 19563 6677 88427 126844 99875 127529 113644 69091 136866 106140 192681 6708 185233 25647 153904 159371 95971 51590 72802 27189 2727 157823 183992 29754 73757 134656 1697...
output:
NO
result:
ok single line: 'NO'
Test #34:
score: 0
Accepted
time: 109ms
memory: 14736kb
input:
1 199990 1388 198605 50975 121777 173124 95675 192142 2934 40114 8762 97502 151068 148937 158439 196125 115277 108436 162601 89008 147711 96892 78631 180569 4834 11769 12958 11585 135529 27035 162566 135359 194508 193810 45239 57541 88264 62357 13361 127923 112153 14597 74853 114074 44360 17793 2451...
output:
NO
result:
ok single line: 'NO'
Test #35:
score: 0
Accepted
time: 68ms
memory: 10640kb
input:
2 130110 4246 125865 99005 40961 121962 24580 66052 114670 26015 27641 107070 116566 87592 8602 41453 24897 33652 50896 104498 80408 127525 45573 92127 67860 60665 121884 26029 102328 25890 63677 106518 91202 78935 66173 57565 116088 125763 50178 56752 99451 128061 36800 65370 13537 54525 37577 5940...
output:
YES YES
result:
ok 2 lines
Test #36:
score: 0
Accepted
time: 41ms
memory: 8328kb
input:
6 27635 22575 5062 27304 18052 17813 6163 20953 10639 22159 25729 20194 19702 13040 2574 27629 16849 11447 7173 702 16006 24377 16687 14594 14285 16770 23620 24389 27554 24480 10606 6738 16514 6117 4947 23856 17614 18656 15402 4588 26086 18881 9437 6072 1716 7400 19942 22334 468 4966 11530 14379 232...
output:
YES NO YES YES YES YES
result:
ok 6 lines
Test #37:
score: 0
Accepted
time: 20ms
memory: 3432kb
input:
1000 28 4 27 24 16 26 1 14 25 2 6 8 3 22 10 5 15 18 27 21 4 11 17 7 23 28 9 20 19 12 13 1 2 6 13 24 20 6 2 15 6 7 2 14 5 2 1 8 3 5 7 1 1 2 1 5 1 2 1 5 24 16 45 37 10 35 17 23 32 7 38 43 6 3 16 26 41 18 44 5 20 4 22 9 33 24 14 28 10 21 1 11 12 42 37 39 29 8 25 15 30 31 2 36 27 40 45 13 34 19 35 17 23...
output:
YES YES YES YES YES NO NO NO NO NO NO YES NO YES NO NO YES YES YES NO NO YES YES YES YES NO NO NO YES NO NO YES YES NO YES YES NO NO YES NO NO YES YES YES NO YES YES NO YES YES NO NO YES YES YES NO YES NO NO NO YES YES NO NO NO NO YES NO YES YES NO YES NO YES NO YES YES YES YES NO YES YES NO NO NO Y...
result:
ok 1000 lines
Test #38:
score: 0
Accepted
time: 20ms
memory: 3364kb
input:
1000 200 66 137 153 6 102 50 38 31 136 163 149 117 19 182 55 25 108 60 61 158 30 27 24 165 104 157 189 73 33 32 100 115 148 164 14 196 181 103 147 45 20 8 155 127 175 162 139 3 78 150 13 99 12 57 94 56 34 119 188 137 76 47 160 4 96 29 192 91 178 62 90 84 15 143 106 101 88 171 173 185 37 174 177 145 ...
output:
NO NO NO NO NO YES NO YES NO NO NO YES YES YES NO YES YES YES YES NO NO YES YES NO YES YES NO NO NO NO NO NO YES YES NO YES YES NO NO NO YES NO NO YES NO YES NO YES NO YES YES NO YES NO YES NO YES NO NO NO NO YES NO YES NO YES YES NO YES YES YES NO NO YES YES YES YES YES YES YES NO YES NO NO NO YES ...
result:
ok 1000 lines
Test #39:
score: 0
Accepted
time: 31ms
memory: 3392kb
input:
1000 538 481 57 298 29 470 505 119 524 153 83 493 351 36 43 16 485 192 218 124 377 507 195 310 262 103 208 212 426 276 304 163 207 93 389 355 114 113 509 523 307 158 17 140 201 96 206 266 126 448 198 67 224 530 511 52 501 179 393 331 395 372 141 162 282 374 111 268 69 461 18 57 2 180 128 466 156 342...
output:
NO NO YES NO YES NO YES YES NO NO NO YES YES YES NO YES NO NO YES YES NO YES YES YES YES YES YES YES NO YES YES YES NO NO YES YES YES NO NO YES YES NO YES NO YES NO NO NO NO NO NO YES YES YES NO YES NO NO NO NO YES YES YES YES YES NO NO YES YES YES YES YES NO NO YES NO YES NO YES NO YES YES YES YES ...
result:
ok 1000 lines
Test #40:
score: 0
Accepted
time: 21ms
memory: 3444kb
input:
1000 137 106 34 6 65 96 23 64 130 21 8 102 7 107 18 49 128 79 116 69 98 119 88 72 66 122 15 43 94 60 11 39 14 28 120 113 51 126 30 89 121 47 82 2 80 77 17 33 52 84 104 45 111 34 93 50 13 68 112 37 105 24 27 129 109 86 91 134 115 103 75 136 101 12 123 63 76 108 73 48 4 137 87 58 67 38 3 125 41 127 85...
output:
NO YES YES NO YES NO YES NO YES YES YES NO YES NO NO NO YES NO YES YES NO YES YES NO NO NO NO YES YES NO NO YES NO YES YES YES YES NO NO YES YES NO YES NO YES YES NO NO YES YES YES YES YES YES YES YES NO YES NO NO NO YES YES NO NO YES NO NO YES YES YES YES YES YES NO YES NO YES NO YES YES YES YES YE...
result:
ok 1000 lines
Test #41:
score: 0
Accepted
time: 28ms
memory: 9404kb
input:
1 200000 100000 65281 200000 199999 199998 199997 199996 199995 199994 199993 199992 199991 199990 199989 199988 199987 199986 199985 199984 199983 199982 199981 199980 199979 199978 199977 199976 199975 199974 199973 199972 199971 199970 199969 199968 199967 199966 199965 199964 199963 199962 19996...
output:
NO
result:
ok single line: 'NO'
Test #42:
score: 0
Accepted
time: 3ms
memory: 6632kb
input:
1 199999 99999 4722 199999 199998 199997 199996 199995 199994 199993 199992 199991 199990 199989 199988 199987 199986 199985 199984 199983 199982 199981 199980 199979 199978 199977 199976 199975 199974 199973 199972 199971 199970 199969 199968 199967 199966 199965 199964 199963 199962 199961 199960 ...
output:
NO
result:
ok single line: 'NO'
Test #43:
score: 0
Accepted
time: 75ms
memory: 13400kb
input:
1 199998 99999 149007 199998 199997 199996 199995 199994 199993 199992 199991 199990 199989 199988 199987 199986 199985 199984 199983 199982 199981 199980 199979 199978 199977 199976 199975 199974 199973 199972 199971 199970 199969 199968 199967 199966 199965 199964 199963 199962 199961 199960 19995...
output:
YES
result:
ok single line: 'YES'
Test #44:
score: 0
Accepted
time: 45ms
memory: 11800kb
input:
1 199997 99998 114264 199997 199996 199995 199994 199993 199992 199991 199990 199989 199988 199987 199986 199985 199984 199983 199982 199981 199980 199979 199978 199977 199976 199975 199974 199973 199972 199971 199970 199969 199968 199967 199966 199965 199964 199963 199962 199961 199960 199959 19995...
output:
YES
result:
ok single line: 'YES'
Test #45:
score: 0
Accepted
time: 80ms
memory: 14816kb
input:
1 199996 99998 177538 99998 99997 99996 99995 99994 99993 99992 99991 99990 99989 99988 99987 99986 99985 99984 99983 99982 99981 99980 99979 99978 99977 99976 99975 99974 99973 99972 99971 99970 99969 99968 99967 99966 99965 99964 99963 99962 99961 99960 99959 99958 99957 99956 99955 99954 99953 99...
output:
YES
result:
ok single line: 'YES'
Test #46:
score: 0
Accepted
time: 47ms
memory: 12088kb
input:
1 199995 99997 119337 99997 99996 99995 99994 99993 99992 99991 99990 99989 99988 99987 99986 99985 99984 99983 99982 99981 99980 99979 99978 99977 99976 99975 99974 99973 99972 99971 99970 99969 99968 99967 99966 99965 99964 99963 99962 99961 99960 99959 99958 99957 99956 99955 99954 99953 99952 99...
output:
YES
result:
ok single line: 'YES'