QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#237058 | #7678. The Game | ucup-team180# | AC ✓ | 225ms | 51200kb | C++17 | 31.1kb | 2023-11-04 13:02:11 | 2023-11-04 13:02:11 |
Judging History
answer
#pragma region Macros
#ifdef noimi
#include "my_template.hpp"
#else
#include <immintrin.h>
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cfenv>
#include <cfloat>
#include <chrono>
#include <cinttypes>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdarg>
#include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <immintrin.h>
#include <initializer_list>
#include <iomanip>
#include <ios>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <streambuf>
#include <string>
#include <tuple>
#include <type_traits>
#include <utility>
#include <variant>
#ifdef noimi
#define oj_local(a, b) b
#else
#define oj_local(a, b) a
#endif
#define LOCAL if(oj_local(0, 1))
#define OJ if(oj_local(1, 0))
using namespace std;
using ll = long long;
using ull = unsigned long long int;
using i128 = __int128_t;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ld = long double;
template <typename T> using vc = vector<T>;
template <typename T> using vvc = vector<vc<T>>;
template <typename T> using vvvc = vector<vvc<T>>;
using vi = vc<int>;
using vl = vc<ll>;
using vpi = vc<pii>;
using vpl = vc<pll>;
template <class T> using pq = priority_queue<T>;
template <class T> using pqg = priority_queue<T, vector<T>, greater<T>>;
template <typename T> int si(const T &x) { return x.size(); }
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); }
vi iota(int n) {
vi a(n);
return iota(a.begin(), a.end(), 0), a;
}
template <typename T> vi iota(const vector<T> &a, bool greater = false) {
vi res(a.size());
iota(res.begin(), res.end(), 0);
sort(res.begin(), res.end(), [&](int i, int j) {
if(greater) return a[i] > a[j];
return a[i] < a[j];
});
return res;
}
// macros
#define overload5(a, b, c, d, e, name, ...) name
#define overload4(a, b, c, d, name, ...) name
#define endl '\n'
#define REP0(n) for(ll jidlsjf = 0; jidlsjf < n; ++jidlsjf)
#define REP1(i, n) for(ll i = 0; i < (n); ++i)
#define REP2(i, a, b) for(ll i = (a); i < (b); ++i)
#define REP3(i, a, b, c) for(ll i = (a); i < (b); i += (c))
#define rep(...) overload4(__VA_ARGS__, REP3, REP2, REP1, REP0)(__VA_ARGS__)
#define per0(n) for(int jidlsjf = 0; jidlsjf < (n); ++jidlsjf)
#define per1(i, n) for(ll i = (n)-1; i >= 0; --i)
#define per2(i, a, b) for(ll i = (a)-1; i >= b; --i)
#define per3(i, a, b, c) for(ll i = (a)-1; i >= (b); i -= (c))
#define per(...) overload4(__VA_ARGS__, per3, per2, per1, per0)(__VA_ARGS__)
#define fore0(a) rep(a.size())
#define fore1(i, a) for(auto &&i : a)
#define fore2(a, b, v) for(auto &&[a, b] : v)
#define fore3(a, b, c, v) for(auto &&[a, b, c] : v)
#define fore4(a, b, c, d, v) for(auto &&[a, b, c, d] : v)
#define fore(...) overload5(__VA_ARGS__, fore4, fore3, fore2, fore1, fore0)(__VA_ARGS__)
#define setbits(j, n) for(ll iiiii = (n), j = lowbit(iiiii); iiiii; iiiii ^= 1 << j, j = lowbit(iiiii))
#define perm(v) for(bool permrepflag = true; (permrepflag ? exchange(permrepflag, false) : next_permutation(all(v)));)
#define fi first
#define se second
#define pb push_back
#define ppb pop_back
#define ppf pop_front
#define eb emplace_back
#define drop(s) cout << #s << endl, exit(0)
#define si(c) (int)(c).size()
#define lb(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define lbg(c, x) distance((c).begin(), lower_bound(all(c), (x), greater{}))
#define ub(c, x) distance((c).begin(), upper_bound(all(c), (x)))
#define ubg(c, x) distance((c).begin(), upper_bound(all(c), (x), greater{}))
#define rng(v, l, r) v.begin() + (l), v.begin() + (r)
#define all(c) begin(c), end(c)
#define rall(c) rbegin(c), rend(c)
#define SORT(v) sort(all(v))
#define REV(v) reverse(all(v))
#define UNIQUE(x) SORT(x), x.erase(unique(all(x)), x.end())
template <typename T = ll, typename S> T SUM(const S &v) { return accumulate(all(v), T(0)); }
#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))
#define overload2(_1, _2, name, ...) name
#define vec(type, name, ...) vector<type> name(__VA_ARGS__)
#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__))))
constexpr pii dx4[4] = {pii{1, 0}, pii{0, 1}, pii{-1, 0}, pii{0, -1}};
constexpr pii dx8[8] = {{1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}, {0, -1}, {1, -1}};
namespace yesno_impl {
const string YESNO[2] = {"NO", "YES"};
const string YesNo[2] = {"No", "Yes"};
const string yesno[2] = {"no", "yes"};
const string firstsecond[2] = {"second", "first"};
const string FirstSecond[2] = {"Second", "First"};
const string possiblestr[2] = {"impossible", "possible"};
const string Possiblestr[2] = {"Impossible", "Possible"};
void YES(bool t = 1) { cout << YESNO[t] << endl; }
void NO(bool t = 1) { YES(!t); }
void Yes(bool t = 1) { cout << YesNo[t] << endl; }
void No(bool t = 1) { Yes(!t); }
void yes(bool t = 1) { cout << yesno[t] << endl; }
void no(bool t = 1) { yes(!t); }
void first(bool t = 1) { cout << firstsecond[t] << endl; }
void First(bool t = 1) { cout << FirstSecond[t] << endl; }
void possible(bool t = 1) { cout << possiblestr[t] << endl; }
void Possible(bool t = 1) { cout << Possiblestr[t] << endl; }
}; // namespace yesno_impl
using namespace yesno_impl;
#define INT(...) \
int __VA_ARGS__; \
IN(__VA_ARGS__)
#define INTd(...) \
int __VA_ARGS__; \
IN2(__VA_ARGS__)
#define LL(...) \
ll __VA_ARGS__; \
IN(__VA_ARGS__)
#define LLd(...) \
ll __VA_ARGS__; \
IN2(__VA_ARGS__)
#define STR(...) \
string __VA_ARGS__; \
IN(__VA_ARGS__)
#define CHR(...) \
char __VA_ARGS__; \
IN(__VA_ARGS__)
#define DBL(...) \
double __VA_ARGS__; \
IN(__VA_ARGS__)
#define VEC(type, name, size) \
vector<type> name(size); \
IN(name)
#define VECd(type, name, size) \
vector<type> name(size); \
IN2(name)
#define VEC2(type, name1, name2, size) \
vector<type> name1(size), name2(size); \
for(int i = 0; i < size; i++) IN(name1[i], name2[i])
#define VEC2d(type, name1, name2, size) \
vector<type> name1(size), name2(size); \
for(int i = 0; i < size; i++) IN2(name1[i], name2[i])
#define VEC3(type, name1, name2, name3, size) \
vector<type> name1(size), name2(size), name3(size); \
for(int i = 0; i < size; i++) IN(name1[i], name2[i], name3[i])
#define VEC3d(type, name1, name2, name3, size) \
vector<type> name1(size), name2(size), name3(size); \
for(int i = 0; i < size; i++) IN2(name1[i], name2[i], name3[i])
#define VEC4(type, name1, name2, name3, name4, size) \
vector<type> name1(size), name2(size), name3(size), name4(size); \
for(int i = 0; i < size; i++) IN(name1[i], name2[i], name3[i], name4[i]);
#define VEC4d(type, name1, name2, name3, name4, size) \
vector<type> name1(size), name2(size), name3(size), name4(size); \
for(int i = 0; i < size; i++) IN2(name1[i], name2[i], name3[i], name4[i]);
#define VV(type, name, h, w) \
vector<vector<type>> name(h, vector<type>(w)); \
IN(name)
#define VVd(type, name, h, w) \
vector<vector<type>> name(h, vector<type>(w)); \
IN2(name)
int scan() { return getchar(); }
void scan(int &a) { cin >> a; }
void scan(long long &a) { cin >> a; }
void scan(char &a) { cin >> a; }
void scan(double &a) { cin >> a; }
void scan(string &a) { cin >> a; }
template <class T, class S> void scan(pair<T, S> &p) { scan(p.first), scan(p.second); }
template <class T> void scan(vector<T> &);
template <class T> void scan(vector<T> &a) {
for(auto &i : a) scan(i);
}
template <class T> void scan(T &a) { cin >> a; }
void IN() {}
void IN2() {}
template <class Head, class... Tail> void IN(Head &head, Tail &...tail) {
scan(head);
IN(tail...);
}
template <class Head, class... Tail> void IN2(Head &head, Tail &...tail) {
scan(head);
--head;
IN2(tail...);
}
template <int p = -1> void pat() {}
template <int p = -1, class Head, class... Tail> void pat(Head &h, Tail &...tail) {
h += p;
pat<p>(tail...);
}
template <typename T, typename S> T ceil(T x, S y) {
assert(y);
return (y < 0 ? ceil(-x, -y) : (x > 0 ? (x + y - 1) / y : x / y));
}
template <typename T, typename S> T floor(T x, S y) {
assert(y);
return (y < 0 ? floor(-x, -y) : (x > 0 ? x / y : x / y - (x % y == 0 ? 0 : 1)));
}
template <typename T, typename S, typename U> U bigmul(const T &x, const S &y, const U &lim) { // clamp(x * y, -lim, lim)
if(x < 0 and y < 0) return bigmul(-x, -y, lim);
if(x < 0) return -bigmul(-x, y, lim);
if(y < 0) return -bigmul(x, -y, lim);
return y == 0 or x <= lim / y ? x * y : lim;
}
template <class T> T POW(T x, int n) {
T res = 1;
for(; n; n >>= 1, x *= x)
if(n & 1) res *= x;
return res;
}
template <class T, class S> T POW(T x, S n, const ll &mod) {
T res = 1;
x %= mod;
for(; n; n >>= 1, x = x * x % mod)
if(n & 1) res = res * x % mod;
return res;
}
vector<pll> factor(ll x) {
vector<pll> ans;
for(ll i = 2; i * i <= x; i++)
if(x % i == 0) {
ans.push_back({i, 1});
while((x /= i) % i == 0) ans.back().second++;
}
if(x != 1) ans.push_back({x, 1});
return ans;
}
template <class T> vector<T> divisor(T x) {
vector<T> ans;
for(T i = 1; i * i <= x; i++)
if(x % i == 0) {
ans.pb(i);
if(i * i != x) ans.pb(x / i);
}
return ans;
}
template <typename T> void zip(vector<T> &x) {
vector<T> y = x;
UNIQUE(y);
for(int i = 0; i < x.size(); ++i) { x[i] = lb(y, x[i]); }
}
template <class S> void fold_in(vector<S> &v) {}
template <typename Head, typename... Tail, class S> void fold_in(vector<S> &v, Head &&a, Tail &&...tail) {
for(auto e : a) v.emplace_back(e);
fold_in(v, tail...);
}
template <class S> void renumber(vector<S> &v) {}
template <typename Head, typename... Tail, class S> void renumber(vector<S> &v, Head &&a, Tail &&...tail) {
for(auto &&e : a) e = lb(v, e);
renumber(v, tail...);
}
template <class S, class... Args> vector<S> zip(vector<S> &head, Args &&...args) {
vector<S> v;
fold_in(v, head, args...);
sort(all(v)), v.erase(unique(all(v)), v.end());
renumber(v, head, args...);
return v;
}
template <typename S> void rearrange(const vector<S> &id) {}
template <typename S, typename T> void rearrange_exec(const vector<S> &id, vector<T> &v) {
vector<T> w(v.size());
rep(i, si(id)) w[i] = v[id[i]];
v.swap(w);
}
// 並び替える順番, 並び替える vector 達
template <typename S, typename Head, typename... Tail> void rearrange(const vector<S> &id, Head &a, Tail &...tail) {
rearrange_exec(id, a);
rearrange(id, tail...);
}
template <typename T> vector<T> RUI(const vector<T> &v) {
vector<T> res(v.size() + 1);
for(int i = 0; i < v.size(); i++) res[i + 1] = res[i] + v[i];
return res;
}
template <typename T> void zeta_supersetsum(vector<T> &f) {
int n = f.size();
for(int i = 1; i < n; i <<= 1) rep(b, n) if(!(i & b)) f[b] += f[b | i];
}
template <typename T> void zeta_subsetsum(vector<T> &f) {
int n = f.size();
for(int i = 1; i < n; i <<= 1) rep(b, n) if(!(i & b)) f[b | i] += f[b];
}
template <typename T> void mobius_subset(vector<T> &f) {
int n = f.size();
for(int i = 1; i < n; i <<= 1) rep(b, n) if(!(i & b)) f[b] -= f[b | i];
}
template <typename T> void mobius_superset(vector<T> &f) {
int n = f.size();
for(int i = 1; i < n; i <<= 1) rep(b, n) if(!(i & b)) f[b | i] -= f[b];
}
// 反時計周りに 90 度回転
template <typename T> void rot(vector<vector<T>> &v) {
if(empty(v)) return;
int n = v.size(), m = v[0].size();
vector<vector<T>> res(m, vector<T>(n));
rep(i, n) rep(j, m) res[m - 1 - j][i] = v[i][j];
v.swap(res);
}
vector<int> counter(const vector<int> &v, int max_num = -1) {
if(max_num == -1) max_num = MAX(v);
vector<int> res(max_num + 1);
fore(e, v) res[e]++;
return res;
}
// x in [l, r)
template <class T, class S> bool inc(const T &x, const S &l, const S &r) { return l <= x and x < r; }
template <class T, class S> bool inc(const T &x, const pair<S, S> &p) { return p.first <= x and x < p.second; }
// 便利関数
constexpr ll ten(int n) { return n == 0 ? 1 : ten(n - 1) * 10; }
constexpr ll tri(ll n) { return n * (n + 1) / 2; }
// l + ... + r
constexpr ll tri(ll l, ll r) { return (l + r) * (r - l + 1) / 2; }
ll max(int x, ll y) { return max((ll)x, y); }
ll max(ll x, int y) { return max(x, (ll)y); }
int min(int x, ll y) { return min((ll)x, y); }
int min(ll x, int y) { return min(x, (ll)y); }
// bit 演算系
#define bit(i) (1LL << i) // (1 << i)
#define test(b, i) (b >> i & 1) // b の i bit 目が立っているか
ll pow2(int i) { return 1LL << i; }
int topbit(signed t) { return t == 0 ? -1 : 31 - __builtin_clz(t); }
int topbit(ll t) { return t == 0 ? -1 : 63 - __builtin_clzll(t); }
int lowbit(signed a) { return a == 0 ? 32 : __builtin_ctz(a); }
int lowbit(ll a) { return a == 0 ? 64 : __builtin_ctzll(a); }
// int allbit(int n) { return (1 << n) - 1; }
constexpr ll mask(int n) { return (1LL << n) - 1; }
// int popcount(signed t) { return __builtin_popcount(t); }
// int popcount(ll t) { return __builtin_popcountll(t); }
int popcount(uint64_t t) { return __builtin_popcountll(t); }
static inline uint64_t popcount64(uint64_t x) {
uint64_t m1 = 0x5555555555555555ll;
uint64_t m2 = 0x3333333333333333ll;
uint64_t m4 = 0x0F0F0F0F0F0F0F0Fll;
uint64_t h01 = 0x0101010101010101ll;
x -= (x >> 1) & m1;
x = (x & m2) + ((x >> 2) & m2);
x = (x + (x >> 4)) & m4;
return (x * h01) >> 56;
}
bool ispow2(int i) { return i && (i & -i) == i; }
ll rnd(ll l, ll r) { //[l, r)
#ifdef noimi
static mt19937_64 gen;
#else
static mt19937_64 gen(chrono::steady_clock::now().time_since_epoch().count());
#endif
return uniform_int_distribution<ll>(l, r - 1)(gen);
}
ll rnd(ll n) { return rnd(0, n); }
template <class t> void random_shuffle(vc<t> &a) { rep(i, si(a)) swap(a[i], a[rnd(0, i + 1)]); }
int in() {
int x;
cin >> x;
return x;
}
ll lin() {
unsigned long long x;
cin >> x;
return x;
}
template <class T, class S> pair<T, S> operator-(const pair<T, S> &x) { return pair<T, S>(-x.first, -x.second); }
template <class T, class S> pair<T, S> operator-(const pair<T, S> &x, const pair<T, S> &y) { return pair<T, S>(x.fi - y.fi, x.se - y.se); }
template <class T, class S> pair<T, S> operator+(const pair<T, S> &x, const pair<T, S> &y) { return pair<T, S>(x.fi + y.fi, x.se + y.se); }
template <class T> pair<T, T> operator&(const pair<T, T> &l, const pair<T, T> &r) { return pair<T, T>(max(l.fi, r.fi), min(l.se, r.se)); }
template <class T, class S> pair<T, S> operator+=(pair<T, S> &l, const pair<T, S> &r) { return l = l + r; }
template <class T, class S> pair<T, S> operator-=(pair<T, S> &l, const pair<T, S> &r) { return l = l - r; }
template <class T> bool intersect(const pair<T, T> &l, const pair<T, T> &r) { return (l.se < r.se ? r.fi < l.se : l.fi < r.se); }
template <class T> vector<T> &operator++(vector<T> &v) {
fore(e, v) e++;
return v;
}
template <class T> vector<T> operator++(vector<T> &v, int) {
auto res = v;
fore(e, v) e++;
return res;
}
template <class T> vector<T> &operator--(vector<T> &v) {
fore(e, v) e--;
return v;
}
template <class T> vector<T> operator--(vector<T> &v, int) {
auto res = v;
fore(e, v) e--;
return res;
}
template <class T> void connect(vector<T> &l, const vector<T> &r) { fore(e, r) l.eb(e); }
template <class T> vector<T> operator+(const vector<T> &l, const vector<T> &r) {
vector<T> res(max(si(l), si(r)));
rep(i, si(l)) res[i] += l[i];
rep(i, si(r)) res[i] += r[i];
return res;
}
template <class T> vector<T> operator-(const vector<T> &l, const vector<T> &r) {
vector<T> res(max(si(l), si(r)));
rep(i, si(l)) res[i] += l[i];
rep(i, si(r)) res[i] -= r[i];
return res;
}
template <class T> vector<T> &operator+=(const vector<T> &l, const vector<T> &r) {
if(si(l) < si(r)) l.resize(si(r));
rep(i, si(r)) l[i] += r[i];
return l;
}
template <class T> vector<T> &operator-=(const vector<T> &l, const vector<T> &r) {
if(si(l) < si(r)) l.resize(si(r));
rep(i, si(r)) l[i] -= r[i];
return l;
}
template <class T> vector<T> &operator+=(vector<T> &v, const T &x) {
fore(e, v) e += x;
return v;
}
template <class T> vector<T> &operator-=(vector<T> &v, const T &x) {
fore(e, v) e -= x;
return v;
}
template <typename T> struct edge {
int from, to;
T cost;
int id;
edge(int to, T cost) : from(-1), to(to), cost(cost) {}
edge(int from, int to, T cost) : from(from), to(to), cost(cost) {}
edge(int from, int to, T cost, int id) : from(from), to(to), cost(cost), id(id) {}
constexpr bool operator<(const edge<T> &rhs) const noexcept { return cost < rhs.cost; }
edge &operator=(const int &x) {
to = x;
return *this;
}
operator int() const { return to; }
friend ostream operator<<(ostream &os, const edge &e) { return os << e.to; }
};
template <typename T> using Edges = vector<edge<T>>;
template <typename T = int> Edges<T> read_edges(int m, bool weighted = false) {
Edges<T> res;
res.reserve(m);
for(int i = 0; i < m; i++) {
int u, v, c = 0;
scan(u), scan(v), u--, v--;
if(weighted) scan(c);
res.eb(u, v, c, i);
}
return res;
}
using Tree = vector<vector<int>>;
using Graph = vector<vector<int>>;
template <class T> using Wgraph = vector<vector<edge<T>>>;
Graph getG(int n, int m = -1, bool directed = false, int margin = 1) {
Tree res(n);
if(m == -1) m = n - 1;
while(m--) {
int a, b;
cin >> a >> b;
a -= margin, b -= margin;
res[a].emplace_back(b);
if(!directed) res[b].emplace_back(a);
}
return res;
}
Graph getTreeFromPar(int n, int margin = 1) {
Graph res(n);
for(int i = 1; i < n; i++) {
int a;
cin >> a;
res[a - margin].emplace_back(i);
}
return res;
}
template <class T> Wgraph<T> getWg(int n, int m = -1, bool directed = false, int margin = 1) {
Wgraph<T> res(n);
if(m == -1) m = n - 1;
while(m--) {
int a, b;
T c;
scan(a), scan(b), scan(c);
a -= margin, b -= margin;
res[a].emplace_back(b, c);
if(!directed) res[b].emplace_back(a, c);
}
return res;
}
void add(Graph &G, int x, int y) { G[x].eb(y), G[y].eb(x); }
template <class S, class T> void add(Wgraph<S> &G, int x, int y, T c) { G[x].eb(y, c), G[y].eb(x, c); }
#define TEST \
INT(testcases); \
while(testcases--)
i128 abs(const i128 &x) { return x > 0 ? x : -x; }
istream &operator>>(istream &is, i128 &v) {
string s;
is >> s;
v = 0;
for(int i = 0; i < (int)s.size(); i++) {
if(isdigit(s[i])) { v = v * 10 + s[i] - '0'; }
}
if(s[0] == '-') { v *= -1; }
return is;
}
ostream &operator<<(ostream &os, const i128 &v) {
if(v == 0) { return (os << "0"); }
i128 num = v;
if(v < 0) {
os << '-';
num = -num;
}
string s;
for(; num > 0; num /= 10) { s.push_back((char)(num % 10) + '0'); }
reverse(s.begin(), s.end());
return (os << s);
}
namespace aux {
template <typename T, unsigned N, unsigned L> struct tp {
static void output(std::ostream &os, const T &v) {
os << std::get<N>(v) << (&os == &cerr ? ", " : " ");
tp<T, N + 1, L>::output(os, v);
}
};
template <typename T, unsigned N> struct tp<T, N, N> {
static void output(std::ostream &os, const T &v) { os << std::get<N>(v); }
};
} // namespace aux
template <typename... Ts> std::ostream &operator<<(std::ostream &os, const std::tuple<Ts...> &t) {
if(&os == &cerr) { os << '('; }
aux::tp<std::tuple<Ts...>, 0, sizeof...(Ts) - 1>::output(os, t);
if(&os == &cerr) { os << ')'; }
return os;
}
template <typename T, typename S, typename U> std::ostream &operator<<(std::ostream &os, const priority_queue<T, S, U> &_pq) {
auto pq = _pq;
vector<T> res;
while(!empty(pq)) res.emplace_back(pq.top()), pq.pop();
return os << res;
}
template <class T, class S> ostream &operator<<(ostream &os, const pair<T, S> &p) {
if(&os == &cerr) { return os << "(" << p.first << ", " << p.second << ")"; }
return os << p.first << " " << p.second;
}
template <class Ch, class Tr, class Container> std::basic_ostream<Ch, Tr> &operator<<(std::basic_ostream<Ch, Tr> &os, const Container &x) {
bool f = true;
if(&os == &cerr) os << "[";
for(auto &y : x) {
if(&os == &cerr)
os << (f ? "" : ", ") << y;
else
os << (f ? "" : " ") << y;
f = false;
}
if(&os == &cerr) os << "]";
return os;
}
#define dump(...) static_cast<void>(0)
#define dbg(...) static_cast<void>(0)
void OUT() { cout << endl; }
template <class Head, class... Tail> void OUT(const Head &head, const Tail &...tail) {
cout << head;
if(sizeof...(tail)) cout << ' ';
OUT(tail...);
}
template <typename T> static constexpr T inf = numeric_limits<T>::max() / 2;
template <class T, class S> constexpr pair<T, S> inf<pair<T, S>> = {inf<T>, inf<S>};
template <class T> void OUT2(const T &t, T INF = inf<T>, T res = -1) { OUT(t != INF ? t : res); }
template <class T> void OUT2(vector<T> &v, T INF = inf<T>, T res = -1) {
fore(e, v) if(e == INF) e = res;
OUT(v);
fore(e, v) if(e == res) e = INF;
}
template <class F> struct REC {
F f;
REC(F &&f_) : f(forward<F>(f_)) {}
template <class... Args> auto operator()(Args &&...args) const { return f(*this, forward<Args>(args)...); }
};
template <class S> vector<pair<S, int>> runLength(const vector<S> &v) {
vector<pair<S, int>> res;
for(auto &e : v) {
if(res.empty() or res.back().fi != e)
res.eb(e, 1);
else
res.back().se++;
}
return res;
}
vector<pair<char, int>> runLength(const string &v) {
vector<pair<char, int>> res;
for(auto &e : v) {
if(res.empty() or res.back().fi != e)
res.eb(e, 1);
else
res.back().se++;
}
return res;
}
struct string_converter {
char start = 0;
char type(const char &c) const { return (islower(c) ? 'a' : isupper(c) ? 'A' : isdigit(c) ? '0' : 0); }
int convert(const char &c) {
if(!start) start = type(c);
return c - start;
}
int convert(const char &c, const string &chars) { return chars.find(c); }
template <typename T> auto convert(const T &v) {
vector<decltype(convert(v[0]))> ret;
ret.reserve(size(v));
for(auto &&e : v) ret.emplace_back(convert(e));
return ret;
}
template <typename T> auto convert(const T &v, const string &chars) {
vector<decltype(convert(v[0], chars))> ret;
ret.reserve(size(v));
for(auto &&e : v) ret.emplace_back(convert(e, chars));
return ret;
}
int operator()(const char &v, char s = 0) {
start = s;
return convert(v);
}
int operator()(const char &v, const string &chars) { return convert(v, chars); }
template <typename T> auto operator()(const T &v, char s = 0) {
start = s;
return convert(v);
}
template <typename T> auto operator()(const T &v, const string &chars) { return convert(v, chars); }
} toint;
template <class T, class F> T bin_search(T ok, T ng, const F &f) {
while(abs(ok - ng) > 1) {
T mid = ok + ng >> 1;
(f(mid) ? ok : ng) = mid;
}
return ok;
}
template <class T, class F> T bin_search_double(T ok, T ng, const F &f, int iter = 80) {
while(iter--) {
// T mid = (ok + ng) / 2;
T mid = sqrtl(ok * ng);
(f(mid) ? ok : ng) = mid;
}
return ok;
}
struct Setup_io {
Setup_io() {
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
cout << fixed << setprecision(11);
}
} setup_io;
#endif
#pragma endregion
void solve() {
LL(n, m);
VEC(ll, a, n);
VEC(ll, b, m);
SORT(a);
SORT(b);
auto aa = a, bb = b;
ll d = n - m;
ll x = 0;
rep(i, m) {
if(a[i + d] > b[i]) {
OUT(-1);
return;
}
x += b[i] - a[i + d];
}
ll y = d - x;
if(y < 0) {
OUT(-1);
return;
}
dump("here");
multiset<ll> A, B, Au;
vl ans;
auto f = [&](ll val) {
// cout<<"#"<<val<<endl;
ans.pb(val);
A.erase(A.find(val));
A.insert(val + 1);
A.erase(A.begin());
y--;
if(val + 1 > *Au.begin()) {
y -= *Au.begin();
Au.erase(Au.begin());
Au.insert(val + 1);
y += val + 1;
}
};
rep(i, n) A.insert(a[i]);
rep(i, m) B.insert(b[i]);
rep(i, m) Au.insert(a[i + d]);
while(y > 0 && si(A) > si(B)) {
f(*A.begin());
dump(A, B, Au);
dump(y);
}
// cout<<"---"<<endl;
vl c;
fore(e, Au) c.pb(e);
per(i, m) {
if(c[i] > b[i]) {
OUT(-1);
return;
}
rep(x, c[i], b[i]) {
f(x);
dump(A, B, Au);
}
}
if(A != B) {
OUT(-1);
return;
}
// fore(e, ans) {
// bool flag = false;
// fore(i, aa) {
// if(i == e) {
// flag = true;
// i++;
// break;
// }
// }
// SORT(aa);
// aa.erase(begin(aa));
// }
// assert(aa == bb);
// OUT(1);
OUT(si(ans));
OUT(ans);
}
int main() {
cin.tie(0);
ios::sync_with_stdio(0);
ll t;
cin >> t;
while(t--) solve();
}
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3544kb
input:
6 5 3 1 2 2 3 3 2 3 4 4 2 1 2 2 4 2 4 5 2 2 3 3 4 4 5 5 6 1 1 1 1 1 1 1 4 4 2 1 1 1 2 2 2 4 1 1 1 1 1 2
output:
2 1 3 -1 3 2 4 4 5 1 1 1 2 3 2 1 1 -1
result:
ok ok (6 test cases)
Test #2:
score: 0
Accepted
time: 3ms
memory: 3456kb
input:
7056 4 3 1 1 1 1 1 1 1 4 3 1 1 1 1 1 1 2 4 3 1 1 1 1 1 1 3 4 3 1 1 1 1 1 1 4 4 3 1 1 1 1 1 1 5 4 3 1 1 1 1 1 1 6 4 3 1 1 1 1 1 2 2 4 3 1 1 1 1 1 2 3 4 3 1 1 1 1 1 2 4 4 3 1 1 1 1 1 2 5 4 3 1 1 1 1 1 2 6 4 3 1 1 1 1 1 3 3 4 3 1 1 1 1 1 3 4 4 3 1 1 1 1 1 3 5 4 3 1 1 1 1 1 3 6 4 3 1 1 1 1 1 4 4 4 3 1 1...
output:
-1 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 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3 1 1 ...
output:
-1 -1 -1 -1 -1 -1 -1 -1 5 1 2 3 4 1 -1 5 1 2 3 1 2 -1 -1 -1 -1 -1 5 1 1 1 1 2 5 1 2 3 1 1 -1 5 1 2 1 2 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 5 2 3 4 1 2 5 2 3 1 2 3 -1 -1 -1 5 1 1 1 1 2 5 1 1 1 2 3 5 2 3 4 1 1 5 1 1 1 2 2 5 2 3 1 2 1 -1 -1 -1 -1 5 2 1 2 1 2 ...
result:
ok ok (17325 test cases)
Test #22:
score: 0
Accepted
time: 9ms
memory: 3552kb
input:
13860 8 6 1 1 1 1 1 1 1 1 1 1 1 1 1 1 8 6 1 1 1 1 1 1 1 1 1 1 1 1 1 2 8 6 1 1 1 1 1 1 1 1 1 1 1 1 1 3 8 6 1 1 1 1 1 1 1 1 1 1 1 1 1 4 8 6 1 1 1 1 1 1 1 1 1 1 1 1 2 2 8 6 1 1 1 1 1 1 1 1 1 1 1 1 2 3 8 6 1 1 1 1 1 1 1 1 1 1 1 1 2 4 8 6 1 1 1 1 1 1 1 1 1 1 1 1 3 3 8 6 1 1 1 1 1 1 1 1 1 1 1 1 3 4 8 6 1 ...
output:
-1 -1 2 1 2 -1 2 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 2 2 3 -1 2 2 1 -1 -1 -1 -1 2 1 1 ...
result:
ok ok (13860 test cases)
Test #23:
score: 0
Accepted
time: 0ms
memory: 3496kb
input:
225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1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok ok (15876 test cases)
Test #25:
score: 0
Accepted
time: 24ms
memory: 3456kb
input:
6000 50 30 2 3 3 1 10 6 8 8 6 8 6 2 4 7 1 2 9 10 3 7 2 4 9 7 10 8 1 2 10 9 2 2 1 10 8 2 6 3 3 9 1 1 9 7 6 6 5 8 10 8 5 4 4 4 9 2 3 4 8 3 10 5 7 3 7 7 10 2 8 5 9 10 1 5 10 8 2 4 2 8 50 30 5 2 2 8 10 9 4 1 8 8 6 10 6 9 2 1 2 2 3 9 10 10 5 1 6 7 4 4 6 5 7 3 1 2 5 2 4 7 10 5 8 5 2 10 8 6 1 1 10 7 2 6 4 ...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok ok (6000 test cases)
Test #26:
score: 0
Accepted
time: 21ms
memory: 3460kb
input:
6000 50 20 3 1 9 1 4 5 5 7 6 5 1 5 9 10 5 3 7 7 7 5 8 2 8 9 4 1 9 5 10 7 9 3 3 2 1 4 5 6 4 4 9 10 5 6 7 6 4 3 7 1 3 5 10 9 4 9 4 10 7 6 3 8 8 1 8 3 8 5 5 4 50 20 5 8 3 8 6 5 4 9 1 2 8 7 9 9 2 4 3 10 10 5 1 3 8 6 8 9 7 7 2 3 8 1 4 2 10 8 4 2 6 10 6 4 8 9 9 9 3 4 6 10 3 7 5 8 4 5 1 1 10 5 4 8 9 4 10 7...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok ok (6000 test cases)
Test #27:
score: 0
Accepted
time: 22ms
memory: 3496kb
input:
3000 100 50 17 14 4 19 12 10 20 20 8 2 20 2 20 6 9 16 18 13 5 9 19 14 10 12 15 5 4 5 10 11 6 9 20 5 5 13 18 9 9 3 15 3 14 16 8 2 8 20 12 13 7 14 1 2 12 17 13 14 6 12 10 7 18 7 2 5 8 20 19 14 12 3 12 5 13 14 3 10 9 13 9 4 7 11 13 7 16 3 1 8 11 16 11 4 9 2 14 12 17 7 10 2 1 15 16 3 11 4 15 3 1 14 12 1...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok ok (3000 test cases)
Test #28:
score: 0
Accepted
time: 18ms
memory: 3516kb
input:
1500 200 100 3 2 6 6 3 4 10 5 10 10 2 10 4 8 1 3 4 1 2 1 2 9 10 6 9 4 2 3 1 6 4 1 6 5 7 1 3 7 3 9 8 1 5 5 8 6 8 4 4 2 5 5 2 4 4 1 2 5 2 10 9 2 9 9 4 10 3 10 10 6 9 3 1 1 3 8 8 10 8 4 1 6 10 4 8 5 2 2 10 3 3 6 5 7 8 5 1 9 10 3 9 4 5 5 2 2 3 9 4 1 1 5 9 1 8 4 9 4 9 3 7 10 7 3 9 6 2 4 5 2 10 5 1 2 4 3 ...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok ok (1500 test cases)
Test #29:
score: 0
Accepted
time: 29ms
memory: 6288kb
input:
3 100000 98000 8 1 8 5 5 9 1 1 7 6 7 9 1 7 10 9 1 6 10 7 4 6 4 8 3 8 6 2 9 3 1 6 4 7 9 4 5 1 3 8 2 3 1 6 9 10 10 9 5 7 4 2 4 5 4 10 9 3 5 7 6 6 5 7 4 1 3 2 6 4 9 4 9 9 5 5 8 8 8 9 3 7 10 7 4 1 9 3 8 8 3 1 9 10 4 7 3 4 6 1 7 1 4 7 2 1 7 6 2 1 8 5 5 1 6 1 6 5 4 1 4 8 2 4 9 4 9 7 5 8 2 4 6 3 6 8 10 3 6...
output:
-1 -1 -1
result:
ok ok (3 test cases)
Test #30:
score: 0
Accepted
time: 32ms
memory: 4672kb
input:
3 100000 100 26628 15576 98990 43976 49647 68346 23924 26821 38507 73889 64208 7286 8583 43126 43052 76461 583 97495 60100 38769 3107 93747 71788 5884 62213 23247 35912 89245 73679 25668 84434 1943 8147 35006 4375 60512 7641 68542 90586 51747 18780 49625 38064 55647 67725 65368 51875 80357 97039 783...
output:
-1 -1 -1
result:
ok ok (3 test cases)
Test #31:
score: 0
Accepted
time: 17ms
memory: 3464kb
input:
6000 50 20 1 1 2 1 2 1 2 1 1 1 2 1 2 1 1 2 2 1 1 1 1 2 1 2 1 2 2 2 2 1 1 2 1 1 2 2 2 2 1 1 1 1 2 2 1 2 1 2 1 2 2 2 2 1 2 2 2 1 2 1 1 1 1 2 2 1 1 1 2 1 50 20 1 1 1 1 1 2 1 1 1 2 2 1 1 2 2 1 1 2 2 1 1 1 2 2 1 2 1 2 1 1 1 1 2 1 1 1 2 2 2 2 1 1 1 2 2 1 2 1 1 1 1 2 1 2 2 2 2 1 2 2 2 2 1 2 1 1 1 2 2 1 50 ...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok ok (6000 test cases)
Test #32:
score: 0
Accepted
time: 60ms
memory: 3540kb
input:
30000 10 6 1 2 3 1 2 3 1 2 2 2 3 3 3 2 3 2 10 6 2 1 1 3 1 1 3 1 3 2 2 3 2 2 4 4 10 6 2 1 2 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 3 3 3 3 3 4 10 9 8 7 5 5 5 5 20 1 1 2 2 2 2 3 3 3 3 4 4 4 10 9 8 8 6 5 5 20 1 1 2 2 3 3 3 3 4 4 4 4 5 5 5 10 8 6 6...
result:
ok ok (6000 test cases)
Test #34:
score: 0
Accepted
time: 72ms
memory: 3464kb
input:
6000 50 30 2 13 7 12 12 8 3 9 3 4 3 14 8 12 3 14 6 2 6 13 10 4 4 1 1 2 10 4 14 4 9 1 1 13 10 6 11 4 12 8 6 13 3 4 14 7 14 5 4 7 13 6 15 14 6 12 6 6 8 9 10 12 14 12 13 11 9 15 6 7 13 7 13 12 9 10 14 8 14 8 50 30 15 2 9 6 13 3 10 8 4 9 6 13 1 12 1 2 13 15 7 3 3 7 15 14 9 10 11 6 3 15 5 10 4 13 3 4 4 1...
output:
20 1 1 2 2 2 3 3 3 3 4 4 14 14 13 12 11 10 8 7 5 20 1 1 2 2 3 3 3 15 14 14 13 13 13 10 9 7 7 7 6 6 20 1 1 1 2 2 3 14 14 13 11 10 9 9 8 8 8 8 7 6 6 20 1 1 1 2 2 3 3 4 4 15 15 13 12 10 9 9 8 6 6 6 20 1 1 1 2 2 3 3 4 4 5 5 5 5 6 6 13 7 7 7 7 20 1 1 2 2 3 3 3 3 4 4 15 12 11 11 11 9 8 7 7 7 20 1 1 2 2 2 ...
result:
ok ok (6000 test cases)
Test #35:
score: 0
Accepted
time: 70ms
memory: 3496kb
input:
6000 50 30 18 6 18 13 8 2 15 6 9 10 14 10 13 11 3 15 9 15 5 15 3 17 16 10 7 10 3 6 5 7 19 1 8 1 17 15 16 11 20 9 1 19 9 15 6 18 1 15 19 19 10 15 16 23 10 20 17 14 11 19 18 13 12 10 19 15 10 18 17 15 10 10 15 15 20 17 15 19 15 14 50 30 14 8 1 11 8 17 11 11 15 13 17 5 11 20 17 20 7 2 3 6 14 12 6 20 14...
output:
20 1 1 2 2 3 3 4 5 5 20 21 22 19 19 18 16 13 11 9 9 20 1 1 2 2 3 3 4 5 5 6 17 14 14 13 12 12 11 11 9 8 19 1 1 1 2 2 2 3 3 4 4 19 15 15 14 12 10 8 8 8 20 1 1 2 2 3 3 3 4 4 18 18 17 16 16 14 10 9 8 8 7 20 1 1 2 2 3 3 4 4 4 4 18 17 11 11 10 8 8 8 7 8 20 1 1 2 2 2 3 20 21 22 20 16 16 15 15 15 12 12 11 9...
result:
ok ok (6000 test cases)
Test #36:
score: 0
Accepted
time: 75ms
memory: 3504kb
input:
6000 50 30 3 15 14 18 15 19 21 8 19 2 4 12 16 20 18 25 14 22 7 4 15 17 1 2 7 17 12 13 4 25 24 7 5 16 18 24 20 2 6 11 5 7 8 6 17 25 7 10 17 6 12 25 10 14 17 18 17 12 19 15 18 17 12 21 22 24 25 18 13 21 18 19 22 16 16 25 16 25 20 14 50 30 14 24 25 2 12 23 1 8 19 20 17 14 4 19 24 2 18 22 7 4 17 18 9 10...
output:
20 1 2 2 3 4 4 5 5 24 21 20 20 19 18 17 17 16 15 15 11 20 1 2 2 3 3 4 24 24 23 22 22 20 21 19 20 19 18 18 17 12 20 1 1 2 2 3 3 3 4 4 5 5 24 21 20 18 17 17 16 15 13 20 1 2 2 3 23 22 21 17 16 16 15 16 13 13 12 13 12 12 10 10 20 1 2 2 3 4 6 25 26 25 26 25 24 22 20 19 19 17 17 14 11 19 1 2 2 3 4 4 5 5 2...
result:
ok ok (6000 test cases)
Test #37:
score: 0
Accepted
time: 103ms
memory: 3600kb
input:
300 1000 800 246 508 46 134 515 412 848 608 126 798 725 18 702 267 623 808 446 816 99 663 688 254 834 715 357 241 843 849 414 522 744 478 887 341 100 598 758 420 988 141 513 994 699 642 213 896 515 687 895 459 211 131 335 44 220 536 632 951 11 709 730 204 475 436 152 250 920 461 547 575 204 794 908 ...
output:
200 2 3 4 4 4 5 5 5 6 7 8 11 12 13 14 14 15 16 17 18 19 19 20 21 21 21 22 23 24 25 27 28 29 30 31 31 32 34 35 36 37 37 38 39 41 43 44 45 46 52 53 53 54 55 58 59 60 61 64 66 67 69 70 71 72 72 73 73 74 76 77 78 79 80 81 82 83 84 85 86 87 88 93 94 97 97 98 99 99 100 100 101 102 102 103 107 108 109 110 ...
result:
ok ok (300 test cases)
Test #38:
score: 0
Accepted
time: 98ms
memory: 3652kb
input:
300 1000 700 387 402 514 158 333 626 917 599 37 843 654 459 642 305 227 87 613 628 210 356 582 589 283 551 733 596 800 242 385 116 4 680 653 757 937 956 910 994 920 59 830 209 213 669 956 886 441 632 450 319 151 381 566 17 703 705 745 962 965 406 971 309 762 943 309 81 490 7 917 194 797 907 670 487 ...
output:
300 4 5 6 7 7 8 8 9 9 10 11 12 13 13 14 14 15 15 16 17 17 18 19 21 22 23 24 25 27 28 29 30 32 34 35 36 37 38 39 40 40 41 41 42 43 43 44 45 46 46 47 49 50 51 52 54 55 56 57 58 59 60 61 63 64 66 69 70 71 72 74 75 75 76 77 78 79 79 80 81 81 82 82 83 83 84 85 86 86 87 87 87 88 88 89 90 91 91 92 93 94 94...
result:
ok ok (300 test cases)
Test #39:
score: 0
Accepted
time: 96ms
memory: 3544kb
input:
300 1000 500 943 269 325 447 277 43 67 545 274 64 681 119 645 971 776 371 889 457 421 939 868 913 575 200 177 215 996 552 582 737 533 756 791 21 749 923 801 817 878 861 104 218 260 898 89 550 919 209 792 665 686 9 988 884 127 475 398 449 392 709 262 385 129 433 558 702 79 132 165 73 499 703 557 805 ...
output:
500 1 2 3 3 4 4 5 5 6 6 7 8 9 10 11 12 13 14 14 15 20 21 24 25 26 27 28 31 32 33 34 35 36 37 38 39 39 40 41 43 43 44 44 45 46 46 47 48 49 50 51 52 52 53 54 55 56 59 60 61 62 64 66 66 67 67 68 68 69 70 71 73 74 75 76 77 78 78 78 79 79 79 80 81 82 83 86 87 88 89 90 90 91 92 93 95 96 97 98 99 99 100 10...
result:
ok ok (300 test cases)
Test #40:
score: 0
Accepted
time: 84ms
memory: 3656kb
input:
300 1000 300 343 99 102 991 677 740 397 454 501 724 261 765 82 256 538 785 427 409 680 269 740 747 443 601 421 838 349 174 754 96 36 419 361 290 865 915 63 582 730 661 683 408 272 123 114 834 746 699 305 933 273 729 934 647 786 27 376 600 839 123 658 796 582 145 68 812 200 855 546 796 283 811 851 70...
output:
700 1 11 13 14 15 20 22 23 24 24 25 26 27 27 28 28 29 29 30 31 32 33 33 34 35 36 37 40 43 44 44 45 47 48 49 50 51 54 57 58 60 61 61 62 62 63 63 64 66 67 68 69 71 72 73 74 75 76 77 82 83 83 84 84 85 85 86 87 87 88 88 89 90 91 92 92 93 93 94 95 96 96 96 97 98 98 99 99 99 100 101 102 103 107 108 112 11...
result:
ok ok (300 test cases)
Test #41:
score: 0
Accepted
time: 83ms
memory: 3596kb
input:
300 1000 100 594 996 948 260 612 869 679 466 541 85 604 111 991 9 16 833 786 215 786 930 343 557 952 6 926 432 898 120 577 166 958 877 927 157 443 551 858 89 758 395 473 690 824 635 127 467 765 166 770 812 254 475 997 473 496 625 894 618 179 242 312 665 677 796 731 407 132 727 231 630 935 417 909 51...
output:
900 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 18 19 20 20 21 22 26 27 27 28 31 31 32 33 36 39 40 41 41 41 42 42 43 43 44 45 46 47 50 51 51 52 52 53 54 55 56 57 58 59 60 61 64 65 67 68 68 69 70 71 72 73 75 76 77 78 78 79 80 83 85 86 88 89 89 90 91 92 93 93 94 95 98 99 101 102 111 111 112 112 113...
result:
ok ok (300 test cases)
Test #42:
score: 0
Accepted
time: 161ms
memory: 19880kb
input:
3 100000 80021 33 74 99 100 44 49 33 41 61 15 26 74 26 79 43 74 99 42 25 64 81 18 75 77 14 34 89 44 55 52 87 97 6 47 100 93 8 97 83 44 56 62 34 44 42 91 50 43 9 1 56 89 45 79 39 15 70 92 80 65 96 66 25 54 93 43 82 14 45 48 87 27 9 57 16 49 27 19 63 64 4 27 81 46 95 68 17 9 12 44 92 30 78 99 84 97 10...
output:
19979 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok (3 test cases)
Test #43:
score: 0
Accepted
time: 137ms
memory: 18880kb
input:
3 100000 70031 67 88 52 29 20 47 14 24 55 21 21 67 1 19 68 85 9 85 48 14 9 70 59 42 19 74 97 24 74 99 38 81 67 96 89 41 52 33 4 54 44 85 85 41 16 43 22 14 67 81 22 32 76 32 58 31 7 42 86 12 4 15 37 100 36 33 48 9 73 71 84 40 7 54 43 86 1 79 23 23 28 94 87 18 45 91 8 7 1 59 69 3 96 35 79 100 24 46 94...
output:
29969 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok (3 test cases)
Test #44:
score: 0
Accepted
time: 162ms
memory: 17404kb
input:
3 100000 60040 6 9 13 59 88 49 98 23 61 18 13 60 68 63 89 96 19 35 83 56 34 30 32 12 21 9 1 93 5 46 81 69 23 37 62 77 91 69 24 68 23 100 28 33 86 6 86 89 10 58 81 62 2 89 81 50 56 5 88 70 16 56 58 43 79 14 19 92 98 2 77 50 96 54 67 19 87 50 75 83 56 70 89 99 78 21 2 96 99 74 50 72 27 75 74 6 55 64 6...
output:
39960 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok (3 test cases)
Test #45:
score: 0
Accepted
time: 141ms
memory: 15804kb
input:
3 100000 50038 44 23 69 88 65 43 70 13 55 12 9 62 44 6 10 14 25 86 7 9 58 87 17 82 22 49 21 73 32 89 32 53 83 86 47 21 19 5 52 81 18 14 83 30 60 73 51 68 68 26 39 93 33 46 96 61 97 68 97 20 25 92 79 86 23 95 77 91 14 29 74 52 90 54 98 60 57 18 32 51 75 41 3 75 27 47 93 90 93 97 23 54 50 14 66 8 82 8...
output:
49962 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok (3 test cases)
Test #46:
score: 0
Accepted
time: 193ms
memory: 41772kb
input:
1 300000 170000 709767392 991931703 440786157 420253632 70142923 541765687 58272546 934857792 30813956 431614551 455745309 196615204 410670889 331951123 899394213 949683236 794740169 16996863 148141492 243752523 547346921 684101439 41901818 592233592 31232642 849937933 205471831 209747680 804177152 ...
output:
130000 1955 7761 10780 11396 12534 14196 17337 17650 18839 20246 20931 30882 35591 35604 35884 40517 46974 48234 48279 49943 54195 58596 61641 62352 63341 69466 69533 71755 74878 78851 85928 102383 108403 114937 118660 122281 123272 127785 129308 130003 137582 157105 157830 163556 165830 166863 1683...
result:
ok ok (1 test case)
Test #47:
score: 0
Accepted
time: 193ms
memory: 44272kb
input:
1 300000 190000 193508934 46076682 94370302 52894499 634904456 988948610 698385762 950193352 828783879 345250094 12189368 547695598 989698943 237711329 383431024 616715369 380412465 439251856 936489405 706380401 185070436 962014678 349821717 1770274 426578143 932462449 882866357 863062269 735148145 ...
output:
110000 20 4571 11710 15214 23463 24799 25036 30981 32478 34436 48396 54127 57946 58991 59125 63105 68145 72849 80218 81840 92587 97193 98089 100126 102723 104507 104674 105488 113357 115544 116023 122028 123289 123429 123895 127833 128106 133237 136994 137178 138128 138781 139713 145504 149060 15578...
result:
ok ok (1 test case)
Test #48:
score: 0
Accepted
time: 216ms
memory: 46856kb
input:
1 300000 210000 937943941 958476582 972740800 999057430 242618296 218037725 909526285 247297242 45499636 953602396 383233664 421568137 15340322 724959104 431661683 294339778 291057712 476111821 872234116 439231753 271475341 742857192 38088985 246106951 300812719 887886874 803950038 697067081 9689621...
output:
90000 2119 3733 21380 28107 29465 31100 33360 35798 36410 38026 38200 44002 48370 50960 58081 58971 59707 59914 74217 76616 80413 80692 80771 86369 91204 91449 95572 97960 100201 100275 103475 103970 104435 105628 110450 112069 114776 114923 117963 119281 119421 119952 136443 140680 141194 143274 14...
result:
ok ok (1 test case)
Test #49:
score: 0
Accepted
time: 175ms
memory: 34968kb
input:
1 300000 120000 420931274 771490051 708595377 566813126 888259157 646597524 769075018 228502759 932704164 688518992 816275899 877437151 875815985 247013832 3094580 153282626 903178752 787225778 649868711 731487240 548510740 789313641 308648524 42171918 92650743 727271019 12221471 346767763 547922230...
output:
180000 707 10162 10291 10925 15304 16956 19486 20297 20754 21227 23406 27239 28733 32914 33030 41849 45957 48468 49186 49783 51348 54133 60897 61475 61952 62551 62768 63105 67580 73467 74601 77211 79975 82635 94907 111380 112389 114879 118301 119503 120553 127402 127940 128921 131317 135394 136208 1...
result:
ok ok (1 test case)
Test #50:
score: 0
Accepted
time: 178ms
memory: 33948kb
input:
1 300000 110000 782432177 323122642 481986660 427741633 168146109 468551284 950318446 80481262 465290345 106453109 974708149 430452616 506448773 781688335 370463621 839712724 432985463 996391985 643703038 812322315 221974202 564019966 926530708 204528089 966633818 41679948 991334285 129691104 279269...
output:
190000 984 6266 11467 11581 16482 21453 22786 24147 25021 26209 27380 27603 32948 38078 39861 40625 43212 44530 46344 48160 52231 55243 55404 57754 59450 59488 66596 70089 76899 76962 82189 82875 88452 91160 104035 108306 109045 112623 115218 117837 120164 120682 132879 146400 151608 154956 159494 1...
result:
ok ok (1 test case)
Test #51:
score: 0
Accepted
time: 225ms
memory: 50180kb
input:
1 300000 240000 940862482 153089417 475587380 26434764 239084494 376280796 208558342 101344679 601910715 244213713 136750605 721370584 827367715 179587448 839559976 22628176 312427413 166250180 737789877 989387813 49772902 16015631 858467356 856103698 307175979 335025812 721521732 795919349 28577568...
output:
60000 83 261 4226 17815 26048 35887 41095 41502 47075 51224 55443 66536 69454 70760 77040 79620 89371 90235 90334 92436 97694 98362 99385 105280 110910 118610 121092 124103 126209 128254 129362 130534 136159 136529 144550 145163 147289 149054 152187 156285 161959 168648 174453 174589 183124 186149 1...
result:
ok ok (1 test case)
Test #52:
score: 0
Accepted
time: 185ms
memory: 41992kb
input:
1 300000 170015 381 505 541 790 757 439 322 481 205 597 11 632 931 455 785 924 913 171 575 424 645 445 13 239 536 137 38 596 271 429 386 704 629 116 421 231 879 268 958 603 326 993 329 208 345 752 469 814 208 748 711 979 370 677 846 126 384 940 932 469 632 81 75 32 419 437 694 611 350 344 235 312 37...
output:
129985 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
result:
ok ok (1 test case)
Test #53:
score: 0
Accepted
time: 151ms
memory: 32980kb
input:
1 300000 100013 929 650 525 808 226 345 356 187 446 576 31 447 776 194 901 904 971 819 570 237 980 344 669 116 795 748 424 683 918 412 780 568 567 596 874 995 65 88 202 479 254 460 280 92 764 516 266 64 699 173 180 889 817 602 132 812 854 176 638 162 272 922 104 206 888 981 975 32 316 885 345 229 18...
output:
199987 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
result:
ok ok (1 test case)
Test #54:
score: 0
Accepted
time: 201ms
memory: 51200kb
input:
1 300000 250000 105 646 656 153 939 189 363 368 120 161 644 928 542 788 867 88 265 901 404 495 572 481 319 562 636 13 344 724 213 605 976 665 394 985 58 442 833 306 991 36 205 610 771 400 587 985 533 197 733 680 355 322 762 722 436 396 828 718 204 734 400 615 483 452 978 644 102 503 358 216 109 644 ...
output:
50000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok (1 test case)
Test #55:
score: 0
Accepted
time: 164ms
memory: 36532kb
input:
1 300000 120021 884 823 816 15 283 962 640 504 440 69 628 692 89 805 496 282 725 345 198 453 487 142 596 628 775 926 763 216 9 284 417 472 764 57 888 272 579 891 349 165 216 553 553 139 220 200 244 16 680 417 165 286 512 512 43 284 611 207 15 374 844 201 511 593 908 343 117 1000 621 590 70 994 936 7...
output:
179979 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2...
result:
ok ok (1 test case)
Test #56:
score: 0
Accepted
time: 32ms
memory: 3592kb
input:
300 1000 300 691 841 625 737 413 460 409 596 319 284 517 674 544 637 621 358 869 687 439 521 259 237 572 744 213 617 488 565 587 166 765 320 225 181 264 185 692 345 619 560 569 331 818 934 326 726 502 81 647 820 517 636 818 751 551 436 52 745 331 420 553 461 304 218 703 323 372 64 412 952 201 796 63...
output:
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 700 1 2 3 5 6 7 8 8 9 12 12 13 14 15 16 19 20 21 22 22 23 24 27 28 29 32 33 35 36 38 39 40 41 42 43 44 46 47 48 52 53 53 54 55 56 57 58 59 59 60 61 62 63 65 66 66 67 68 69 71 73 74 75 77 78 79 79 80 81 82 83 84 87 87 88 88 89 89 90 91 92 92 93 94 96...
result:
ok ok (300 test cases)
Test #57:
score: 0
Accepted
time: 76ms
memory: 3536kb
input:
300 1000 101 439 550 130 321 685 852 667 621 723 524 452 202 528 628 125 260 48 641 835 678 929 362 335 863 542 949 759 432 255 392 332 272 359 265 43 472 125 326 868 792 692 175 470 336 914 575 305 784 533 926 306 272 113 369 434 512 515 769 496 946 418 704 762 827 392 191 256 326 365 475 722 432 4...
output:
-1 899 4 4 5 6 6 7 8 9 14 16 17 18 19 20 21 22 24 25 28 28 29 29 30 31 33 34 35 35 36 38 40 41 41 42 43 44 45 46 48 48 49 50 51 52 53 55 56 57 57 58 58 59 59 60 61 62 63 64 64 65 66 66 67 67 68 69 70 70 71 71 72 73 74 74 75 76 78 79 80 81 83 85 86 86 87 88 89 89 90 92 93 94 94 95 95 96 97 98 100 100...
result:
ok ok (300 test cases)
Test #58:
score: 0
Accepted
time: 32ms
memory: 6008kb
input:
3 100000 80016 77 32 77 53 21 33 26 97 39 66 70 65 63 91 64 97 62 69 66 12 59 27 58 30 27 55 46 57 21 70 61 88 43 56 8 27 87 39 90 37 75 47 85 33 27 99 90 53 76 23 4 86 66 75 78 2 87 39 88 77 1 1 6 89 54 28 10 13 83 97 73 42 21 29 46 5 14 64 74 14 60 53 9 76 67 36 64 59 30 74 5 41 43 5 78 14 48 69 4...
output:
-1 -1 -1
result:
ok ok (3 test cases)
Test #59:
score: 0
Accepted
time: 162ms
memory: 18632kb
input:
3 100000 70016 27 42 70 76 44 64 30 68 73 77 74 77 60 96 59 71 51 67 7 65 28 61 76 81 7 57 32 5 4 73 59 91 34 87 77 11 73 92 93 61 33 92 27 40 29 35 78 96 97 68 71 34 55 40 20 44 86 95 82 8 87 76 59 65 71 48 29 10 35 23 1 25 91 82 13 30 18 26 7 73 72 68 63 83 73 27 61 57 83 21 57 100 39 18 85 91 80 ...
output:
29984 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok (3 test cases)
Test #60:
score: 0
Accepted
time: 199ms
memory: 49344kb
input:
1 300000 230010 897 623 888 292 809 692 387 896 943 932 304 297 692 366 947 282 953 358 832 42 288 685 9 1 936 207 633 71 60 507 964 174 765 119 148 539 732 674 438 545 321 737 147 357 751 786 312 523 285 131 422 128 246 916 290 141 258 832 214 819 915 297 798 329 785 601 836 232 214 154 597 568 595...
output:
69990 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok (1 test case)
Test #61:
score: 0
Accepted
time: 182ms
memory: 39516kb
input:
1 300000 150016 1236 1469 902 1714 10 1447 907 249 1895 165 1498 1964 1141 1622 1620 1095 463 1729 1071 937 1875 1325 660 1892 407 1015 1890 559 193 463 298 676 270 1530 449 754 172 561 1649 1419 591 113 8 631 672 1386 231 1936 377 880 148 1556 218 1789 1464 1703 1864 1709 1202 1134 232 1936 787 388...
output:
149984 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...
result:
ok ok (1 test case)
Test #62:
score: 0
Accepted
time: 186ms
memory: 45868kb
input:
1 300000 200012 571 81 248 126 847 51 482 746 518 366 418 926 287 81 899 914 718 740 489 305 60 869 344 520 77 163 237 75 312 142 594 370 803 781 558 24 325 534 171 364 914 849 639 481 923 325 35 438 811 66 719 39 891 422 428 361 134 697 640 97 718 632 166 54 853 813 619 556 789 165 634 958 409 633 ...
output:
99988 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok (1 test case)
Test #63:
score: 0
Accepted
time: 150ms
memory: 30916kb
input:
1 300000 80046 114 853 56 319 707 33 570 87 378 860 968 447 17 731 728 539 63 934 851 855 170 562 927 730 288 398 173 558 244 505 996 562 200 298 860 616 397 671 748 991 428 559 814 113 744 576 965 526 418 209 197 904 812 169 356 13 687 423 121 129 317 551 884 401 583 267 134 504 168 992 524 134 551...
output:
219954 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2...
result:
ok ok (1 test case)
Test #64:
score: 0
Accepted
time: 3ms
memory: 3548kb
input:
10000 1 1 1 1 1 1 1 2 1 1 1 3 1 1 1 4 1 1 1 5 1 1 1 6 1 1 1 7 1 1 1 8 1 1 1 9 1 1 1 10 1 1 1 11 1 1 1 12 1 1 1 13 1 1 1 14 1 1 1 15 1 1 1 16 1 1 1 17 1 1 1 18 1 1 1 19 1 1 1 20 1 1 1 21 1 1 1 22 1 1 1 23 1 1 1 24 1 1 1 25 1 1 1 26 1 1 1 27 1 1 1 28 1 1 1 29 1 1 1 30 1 1 1 31 1 1 1 32 1 1 1 33 1 1 1 ...
output:
0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok ok (10000 test cases)
Test #65:
score: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1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok (3 test cases)
Test #67:
score: 0
Accepted
time: 140ms
memory: 13080kb
input:
3 100000 30000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
70000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok ok (3 test cases)
Test #68:
score: 0
Accepted
time: 154ms
memory: 35116kb
input:
1 300000 100008 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1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 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
result:
ok ok (1 test case)
Test #70:
score: 0
Accepted
time: 186ms
memory: 34448kb
input:
1 300000 100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
200000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
result:
ok ok (1 test case)
Test #71:
score: 0
Accepted
time: 121ms
memory: 21760kb
input:
1 300000 1 71816290 577646983 841557369 852043746 37126487 102223060 27715306 985870035 216706329 968907371 382088914 712120946 646596707 19156351 54849033 944516763 64421318 280320825 263193207 301370979 636866597 205058358 906742170 462877840 983077175 366579207 454735621 343423516 635019273 91142...
output:
299999 3389 4044 5754 8056 8815 9110 12083 13705 17222 20787 25071 34351 37265 37541 44020 44127 45370 58613 67964 68686 69865 71058 71108 71743 74006 74250 77600 78913 80322 81549 94444 96843 97615 107151 110612 116449 119175 119529 124392 124963 130319 130803 132202 138042 138388 141021 144476 144...
result:
ok ok (1 test case)
Test #72:
score: 0
Accepted
time: 123ms
memory: 22012kb
input:
1 300000 1 218913978 615464987 743073221 515774957 831116744 706991219 714083282 132771050 486347397 612395546 905208402 292753830 845992678 608321189 209744867 361269104 223173331 27182269 701530201 445755372 436970664 940306081 790682425 212538258 723697592 87734945 465842238 540595244 9553605 886...
output:
299999 673 1924 7400 9599 17611 17863 18123 27356 28844 32269 36172 37468 40661 44603 47158 53958 55190 56024 57150 57240 58624 65264 103026 104897 108639 116262 117697 118197 120661 127346 129389 129474 129808 135789 137061 137613 151873 154543 156802 157864 162340 162774 164618 167488 187829 18805...
result:
ok ok (1 test case)
Test #73:
score: 0
Accepted
time: 153ms
memory: 22032kb
input:
1 300000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
299999 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 1...
result:
ok ok (1 test case)
Test #74:
score: 0
Accepted
time: 147ms
memory: 26544kb
input:
1 300000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
299999 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
result:
ok ok (1 test case)
Extra Test:
score: 0
Extra Test Passed