QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#862258 | #9975. Hitoshizuku | ucup-team1134# | AC ✓ | 78ms | 13756kb | C++23 | 14.0kb | 2025-01-18 23:23:09 | 2025-01-18 23:23:27 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pair<int,int>>
#define vll vector<pair<ll,ll>>
#define vvi vector<vector<int>>
#define vvl vector<vector<ll>>
#define vvii vector<vector<pair<int,int>>>
#define vvll vector<vector<pair<ll,ll>>>
#define vst vector<string>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define mkunique(x) sort(all(x));(x).erase(unique(all(x)),(x).end())
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=998244353,MAX=300005,INF=15<<26;
// BIT セグ木 遅延セグ木 のみ
// from: https://gist.github.com/yosupo06/ddd51afb727600fd95d9d8ad6c3c80c9
// (based on AtCoder STL)
#include <algorithm>
#include <array>
#ifdef _MSC_VER
#include <intrin.h>
#endif
namespace atcoder {
namespace internal {
int ceil_pow2(int n) {
int x = 0;
while ((1U << x) < (unsigned int)(n)) x++;
return x;
}
int bsf(unsigned int n) {
#ifdef _MSC_VER
unsigned long index;
_BitScanForward(&index, n);
return index;
#else
return __builtin_ctz(n);
#endif
}
} // namespace internal
} // namespace atcoder
#include <cassert>
#include <numeric>
#include <type_traits>
namespace atcoder {
namespace internal {
#ifndef _MSC_VER
template <class T>
using is_signed_int128 =
typename std::conditional<std::is_same<T, __int128_t>::value ||
std::is_same<T, __int128>::value,
std::true_type,
std::false_type>::type;
template <class T>
using is_unsigned_int128 =
typename std::conditional<std::is_same<T, __uint128_t>::value ||
std::is_same<T, unsigned __int128>::value,
std::true_type,
std::false_type>::type;
template <class T>
using make_unsigned_int128 =
typename std::conditional<std::is_same<T, __int128_t>::value,
__uint128_t,
unsigned __int128>;
template <class T>
using is_integral = typename std::conditional<std::is_integral<T>::value ||
is_signed_int128<T>::value ||
is_unsigned_int128<T>::value,
std::true_type,
std::false_type>::type;
template <class T>
using is_signed_int = typename std::conditional<(is_integral<T>::value &&
std::is_signed<T>::value) ||
is_signed_int128<T>::value,
std::true_type,
std::false_type>::type;
template <class T>
using is_unsigned_int =
typename std::conditional<(is_integral<T>::value &&
std::is_unsigned<T>::value) ||
is_unsigned_int128<T>::value,
std::true_type,
std::false_type>::type;
template <class T>
using to_unsigned = typename std::conditional<
is_signed_int128<T>::value,
make_unsigned_int128<T>,
typename std::conditional<std::is_signed<T>::value,
std::make_unsigned<T>,
std::common_type<T>>::type>::type;
#else
template <class T> using is_integral = typename std::is_integral<T>;
template <class T>
using is_signed_int =
typename std::conditional<is_integral<T>::value && std::is_signed<T>::value,
std::true_type,
std::false_type>::type;
template <class T>
using is_unsigned_int =
typename std::conditional<is_integral<T>::value &&
std::is_unsigned<T>::value,
std::true_type,
std::false_type>::type;
template <class T>
using to_unsigned = typename std::conditional<is_signed_int<T>::value,
std::make_unsigned<T>,
std::common_type<T>>::type;
#endif
template <class T>
using is_signed_int_t = std::enable_if_t<is_signed_int<T>::value>;
template <class T>
using is_unsigned_int_t = std::enable_if_t<is_unsigned_int<T>::value>;
template <class T> using to_unsigned_t = typename to_unsigned<T>::type;
} // namespace internal
} // namespace atcoder
#include <cassert>
#include <vector>
namespace atcoder {
template <class T> struct fenwick_tree {
using U = internal::to_unsigned_t<T>;
public:
fenwick_tree() : _n(0) {}
fenwick_tree(int n) : _n(n), data(n) {}
void add(int p, T x) {
assert(0 <= p && p < _n);
p++;
while (p <= _n) {
data[p - 1] += U(x);
p += p & -p;
}
}
T sum(int l, int r) {
assert(0 <= l && l <= r && r <= _n);
return sum(r) - sum(l);
}
private:
int _n;
std::vector<U> data;
U sum(int r) {
U s = 0;
while (r > 0) {
s += data[r - 1];
r -= r & -r;
}
return s;
}
};
} // namespace atcoder
#include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>
namespace atcoder {
template <class S,
S (*op)(S, S),
S (*e)(),
class F,
S (*mapping)(F, S),
F (*composition)(F, F),
F (*id)()>
struct lazy_segtree {
public:
lazy_segtree() : lazy_segtree(0) {}
lazy_segtree(int n) : lazy_segtree(std::vector<S>(n, e())) {}
lazy_segtree(const std::vector<S>& v) : _n(int(v.size())) {
log = internal::ceil_pow2(_n);
size = 1 << log;
d = std::vector<S>(2 * size, e());
lz = std::vector<F>(size, id());
for (int i = 0; i < _n; i++) d[size + i] = v[i];
for (int i = size - 1; i >= 1; i--) {
update(i);
}
}
void set(int p, S x) {
assert(0 <= p && p < _n);
p += size;
for (int i = log; i >= 1; i--) push(p >> i);
d[p] = x;
for (int i = 1; i <= log; i++) update(p >> i);
}
S get(int p) {
assert(0 <= p && p < _n);
p += size;
for (int i = log; i >= 1; i--) push(p >> i);
return d[p];
}
S prod(int l, int r) {
assert(0 <= l && l <= r && r <= _n);
if (l == r) return e();
l += size;
r += size;
for (int i = log; i >= 1; i--) {
if (((l >> i) << i) != l) push(l >> i);
if (((r >> i) << i) != r) push(r >> i);
}
S sml = e(), smr = e();
while (l < r) {
if (l & 1) sml = op(sml, d[l++]);
if (r & 1) smr = op(d[--r], smr);
l >>= 1;
r >>= 1;
}
return op(sml, smr);
}
S all_prod() { return d[1]; }
void apply(int p, F f) {
assert(0 <= p && p < _n);
p += size;
for (int i = log; i >= 1; i--) push(p >> i);
d[p] = mapping(f, d[p]);
for (int i = 1; i <= log; i++) update(p >> i);
}
void apply(int l, int r, F f) {
assert(0 <= l && l <= r && r <= _n);
if (l == r) return;
l += size;
r += size;
for (int i = log; i >= 1; i--) {
if (((l >> i) << i) != l) push(l >> i);
if (((r >> i) << i) != r) push((r - 1) >> i);
}
{
int l2 = l, r2 = r;
while (l < r) {
if (l & 1) all_apply(l++, f);
if (r & 1) all_apply(--r, f);
l >>= 1;
r >>= 1;
}
l = l2;
r = r2;
}
for (int i = 1; i <= log; i++) {
if (((l >> i) << i) != l) update(l >> i);
if (((r >> i) << i) != r) update((r - 1) >> i);
}
}
template <bool (*g)(S)> int max_right(int l) {
return max_right(l, [](S x) { return g(x); });
}
template <class G> int max_right(int l, G g) {
assert(0 <= l && l <= _n);
assert(g(e()));
if (l == _n) return _n;
l += size;
for (int i = log; i >= 1; i--) push(l >> i);
S sm = e();
do {
while (l % 2 == 0) l >>= 1;
if (!g(op(sm, d[l]))) {
while (l < size) {
push(l);
l = (2 * l);
if (g(op(sm, d[l]))) {
sm = op(sm, d[l]);
l++;
}
}
return l - size;
}
sm = op(sm, d[l]);
l++;
} while ((l & -l) != l);
return _n;
}
template <bool (*g)(S)> int min_left(int r) {
return min_left(r, [](S x) { return g(x); });
}
template <class G> int min_left(int r, G g) {
assert(0 <= r && r <= _n);
assert(g(e()));
if (r == 0) return 0;
r += size;
for (int i = log; i >= 1; i--) push((r - 1) >> i);
S sm = e();
do {
r--;
while (r > 1 && (r % 2)) r >>= 1;
if (!g(op(d[r], sm))) {
while (r < size) {
push(r);
r = (2 * r + 1);
if (g(op(d[r], sm))) {
sm = op(d[r], sm);
r--;
}
}
return r + 1 - size;
}
sm = op(d[r], sm);
} while ((r & -r) != r);
return 0;
}
private:
int _n, size, log;
std::vector<S> d;
std::vector<F> lz;
void update(int k) { d[k] = op(d[2 * k], d[2 * k + 1]); }
void all_apply(int k, F f) {
d[k] = mapping(f, d[k]);
if (k < size) lz[k] = composition(f, lz[k]);
}
void push(int k) {
all_apply(2 * k, lz[k]);
all_apply(2 * k + 1, lz[k]);
lz[k] = id();
}
};
} // namespace atcoder
#include <algorithm>
#include <cassert>
#include <vector>
namespace atcoder {
template <class S, S (*op)(S, S), S (*e)()> struct segtree {
public:
segtree() : segtree(0) {}
segtree(int n) : segtree(std::vector<S>(n, e())) {}
segtree(const std::vector<S>& v) : _n(int(v.size())) {
log = internal::ceil_pow2(_n);
size = 1 << log;
d = std::vector<S>(2 * size, e());
for (int i = 0; i < _n; i++) d[size + i] = v[i];
for (int i = size - 1; i >= 1; i--) {
update(i);
}
}
void set(int p, S x) {
assert(0 <= p && p < _n);
p += size;
d[p] = x;
for (int i = 1; i <= log; i++) update(p >> i);
}
S get(int p) {
assert(0 <= p && p < _n);
return d[p + size];
}
S prod(int l, int r) {
assert(0 <= l && l <= r && r <= _n);
S sml = e(), smr = e();
l += size;
r += size;
while (l < r) {
if (l & 1) sml = op(sml, d[l++]);
if (r & 1) smr = op(d[--r], smr);
l >>= 1;
r >>= 1;
}
return op(sml, smr);
}
S all_prod() { return d[1]; }
template <bool (*f)(S)> int max_right(int l) {
return max_right(l, [](S x) { return f(x); });
}
template <class F> int max_right(int l, F f) {
assert(0 <= l && l <= _n);
assert(f(e()));
if (l == _n) return _n;
l += size;
S sm = e();
do {
while (l % 2 == 0) l >>= 1;
if (!f(op(sm, d[l]))) {
while (l < size) {
l = (2 * l);
if (f(op(sm, d[l]))) {
sm = op(sm, d[l]);
l++;
}
}
return l - size;
}
sm = op(sm, d[l]);
l++;
} while ((l & -l) != l);
return _n;
}
template <bool (*f)(S)> int min_left(int r) {
return min_left(r, [](S x) { return f(x); });
}
template <class F> int min_left(int r, F f) {
assert(0 <= r && r <= _n);
assert(f(e()));
if (r == 0) return 0;
r += size;
S sm = e();
do {
r--;
while (r > 1 && (r % 2)) r >>= 1;
if (!f(op(d[r], sm))) {
while (r < size) {
r = (2 * r + 1);
if (f(op(d[r], sm))) {
sm = op(d[r], sm);
r--;
}
}
return r + 1 - size;
}
sm = op(d[r], sm);
} while ((r & -r) != r);
return 0;
}
private:
int _n, size, log;
std::vector<S> d;
void update(int k) { d[k] = op(d[2 * k], d[2 * k + 1]); }
};
} // namespace atcoder
using T=int;
T f(T a,T b){
return min(a,b);
}
T ti(){
return INF;
}
T tar;
bool ff(T x){
return x>tar;
}
int main(){
std::ifstream in("text.txt");
std::cin.rdbuf(in.rdbuf());
cin.tie(0);
ios::sync_with_stdio(false);
int Q;cin>>Q;
while(Q--){
int N;cin>>N;
vector<array<int,3>> S(3*N);
for(int i=0;i<3*N;i++){
cin>>S[i][0]>>S[i][1];
S[i][2]=i+1;
}
sort(all(S),[&](auto a,auto b){
return a[1]<b[1];
});
vector<T> def(3*N);
for(int i=0;i<3*N;i++){
def[i]=S[i][0];
}
atcoder::segtree<T,f,ti> seg(def);
vector<array<int,3>> ans;
int i=0;
while(i<3*N){
if(seg.get(i)==INF){
i++;
}else{
int st=i+1;
vi Z;
Z.pb(i);
for(int q=0;q<2;q++){
tar=S[i][1];
int r=seg.max_right<ff>(st);
if(r==3*N) break;
Z.pb(r);
seg.set(r,INF);
st=r+1;
}
if(si(Z)<3) break;
ans.pb({Z[0],Z[1],Z[2]});
seg.set(i,INF);
}
}
if(si(ans)==N){
cout<<"Yes\n";
for(auto [a,b,c]:ans) cout<<S[a][2]<<" "<<S[b][2]<<" "<<S[c][2]<<"\n";
}else{
cout<<"No\n";
}
}
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3712kb
input:
2 2 1 2 2 2 2 3 3 5 4 4 4 5 1 1 1 1 1000000000 1000000000 1000000000
output:
Yes 1 2 3 5 4 6 No
result:
ok >_< (2 test cases)
Test #2:
score: 0
Accepted
time: 52ms
memory: 3584kb
input:
100000 1 164154503 167959139 178382610 336470888 12298535 642802746 1 165064830 773386884 353585658 396628655 792066242 971207868 1 1607946 2087506 21674839 46761498 9518201 16843338 1 262361007 691952768 190585553 787375312 637191526 693319712 1 41970708 45277106 197619816 762263554 308360206 40724...
output:
No No No Yes 1 3 2 No Yes 2 1 3 No No No No No Yes 2 1 3 Yes 1 2 3 No No No No Yes 2 3 1 No Yes 2 3 1 No No Yes 2 3 1 No No Yes 3 1 2 No No No No No No No Yes 3 2 1 No No Yes 3 2 1 No No No No No No No No No No No No Yes 3 2 1 No No Yes 2 3 1 Yes 3 2 1 No No Yes 2 1 3 No No No Yes 1 2 3 Yes 3 2 1 No...
result:
ok >_< (100000 test cases)
Test #3:
score: 0
Accepted
time: 45ms
memory: 3584kb
input:
50000 2 36364670 641009859 15071436 75475634 20446080 476927808 357784519 503158867 206641725 322595515 268011721 645468307 2 247717926 939887597 808609669 973764525 496738491 710156469 463547010 860350786 757388873 784695957 29903136 208427221 2 26681139 67590963 458238185 475357775 80127817 135993...
output:
No No No No No No No No No No No No Yes 5 4 6 2 3 1 No No No No No No No No No No No No No No No No Yes 2 6 1 5 4 3 No No No No No No No Yes 3 6 2 1 5 4 No No No No No Yes 4 2 1 6 3 5 Yes 2 6 3 1 4 5 No No No Yes 3 4 2 5 1 6 No No Yes 6 5 3 1 2 4 Yes 2 5 6 1 4 3 Yes 2 5 3 6 4 1 No Yes 4 6 3 5 2 1 No...
result:
ok >_< (50000 test cases)
Test #4:
score: 0
Accepted
time: 46ms
memory: 3584kb
input:
33333 3 405068225 524125987 162463453 374288891 493199993 751244358 111234434 232930851 71448581 543529670 158749276 319728747 238956600 582720391 320275833 490702144 111160223 138628383 3 23006185 733781508 636477523 931759705 585852932 723534730 388969099 794937524 153929016 188451996 7487968 1448...
output:
No No No No No No No No No No No No No No No No No No No No Yes 9 7 1 6 8 3 4 2 5 No No Yes 6 1 8 2 7 5 4 3 9 No No No Yes 5 7 9 1 4 2 6 8 3 Yes 3 7 5 2 4 9 1 6 8 No Yes 2 4 6 5 9 3 8 1 7 Yes 8 9 1 2 6 3 7 5 4 No No No Yes 5 8 2 1 9 4 7 3 6 No No No Yes 9 6 4 3 2 1 5 8 7 No Yes 4 5 6 3 9 8 2 7 1 No ...
result:
ok >_< (33333 test cases)
Test #5:
score: 0
Accepted
time: 46ms
memory: 3584kb
input:
25000 4 387784488 702209411 329025563 673102149 394641352 730593611 244761087 812959730 198875143 469496529 425799311 699021890 715498963 815487777 765027712 857896659 160339866 421876106 477145912 902179526 264824816 783856158 26239891 238642240 4 588094643 962475573 90297216 196513513 234289482 33...
output:
Yes 12 9 5 2 6 1 3 11 4 7 8 10 No No No No No No No Yes 2 9 8 1 6 12 7 3 10 11 5 4 No No Yes 3 11 4 12 10 5 2 1 9 7 6 8 Yes 10 1 9 3 6 4 8 12 7 11 2 5 No No No Yes 9 2 12 5 6 7 10 8 1 4 11 3 No No No No No Yes 10 9 5 1 7 4 6 3 8 2 11 12 No Yes 6 3 9 12 7 2 1 4 11 8 10 5 No No No Yes 9 12 2 7 4 5 11 ...
result:
ok >_< (25000 test cases)
Test #6:
score: 0
Accepted
time: 45ms
memory: 3712kb
input:
20000 5 255424772 585325539 298257969 412106895 366545795 564718673 426199147 837699009 609084202 690430685 367932561 373282330 488491851 753287868 18693151 79866982 629564684 850348020 7594098 480642952 376090136 930919906 592321264 903492853 345689007 984789430 895853014 909607734 122083425 211655...
output:
No Yes 3 7 15 8 5 11 4 13 9 2 14 1 6 12 10 Yes 12 3 4 5 11 1 6 8 2 7 15 14 10 9 13 No Yes 11 15 2 7 9 6 3 8 12 13 14 10 1 5 4 No No No No Yes 6 2 5 14 1 4 9 11 15 10 13 8 12 7 3 No No Yes 8 4 3 6 1 15 7 12 11 10 13 5 14 2 9 Yes 14 10 11 1 13 15 3 9 12 2 4 5 8 6 7 Yes 5 6 8 9 7 11 2 14 10 13 12 15 3 ...
result:
ok >_< (20000 test cases)
Test #7:
score: 0
Accepted
time: 47ms
memory: 3584kb
input:
16666 6 26845100 58376259 4489038 5887448 307580079 544067926 473165155 712695184 842055718 911364840 851679243 902318577 17646538 250896470 562282480 742028793 60193924 133595743 573222241 649040970 189379234 223207847 301595726 418600362 105036855 417168695 446368438 622701955 89667978 235369723 2...
output:
No No Yes 14 10 11 15 2 3 4 6 16 18 9 7 12 8 17 1 5 13 No Yes 12 15 10 4 1 9 5 7 18 16 11 14 6 17 2 13 3 8 Yes 14 5 17 15 3 11 1 8 4 18 6 2 16 10 9 13 12 7 Yes 14 1 13 9 7 10 4 15 12 3 2 8 11 17 6 16 18 5 No Yes 3 7 8 4 1 16 14 18 12 13 9 15 6 10 5 11 17 2 Yes 8 9 3 7 1 16 6 14 12 18 17 11 4 2 15 5 ...
result:
ok >_< (16666 test cases)
Test #8:
score: 0
Accepted
time: 50ms
memory: 3584kb
input:
14285 7 498283426 941492387 435838088 449924898 60069608 378192988 2943111 147499872 449114197 837331700 157821356 576579017 175187302 188696560 119961285 669031820 613970072 826908873 631375408 817438988 79062948 370271596 137867063 638740575 161249104 439482552 40882880 335796176 97823227 25908403...
output:
Yes 4 21 15 7 14 11 3 13 16 2 6 20 12 8 18 17 10 9 5 1 19 No Yes 1 17 13 20 12 16 8 5 21 6 11 15 14 18 7 10 19 3 4 9 2 Yes 5 16 18 2 1 11 10 4 13 15 17 12 9 20 21 14 19 6 8 7 3 Yes 19 21 10 9 20 3 12 2 6 5 15 16 7 14 8 17 18 4 1 13 11 No No No No No No No Yes 3 11 20 5 9 10 14 17 16 2 13 4 18 1 15 6...
result:
ok >_< (14285 test cases)
Test #9:
score: 0
Accepted
time: 50ms
memory: 3712kb
input:
12500 8 109970553 824608515 38308643 43705451 617662368 652509537 56888590 317463343 17277529 58265855 96899941 250839457 10202459 126496650 221863474 331193631 98584951 255380788 66986639 690869710 118913405 222368048 3832128 8623893 411234159 461796409 101768229 194114590 63466173 137574156 159144...
output:
No No Yes 6 2 19 1 5 16 11 12 3 20 15 8 7 23 14 21 17 22 18 10 13 24 9 4 No No No Yes 9 18 1 5 14 6 17 12 7 13 21 19 3 4 16 15 11 20 10 22 24 8 2 23 Yes 23 2 3 1 5 6 8 22 11 16 15 19 9 17 13 24 10 7 14 18 20 21 12 4 No Yes 7 12 10 14 21 8 20 4 19 5 2 22 18 23 15 13 24 3 17 1 16 9 11 6 Yes 10 17 22 2...
result:
ok >_< (12500 test cases)
Test #10:
score: 0
Accepted
time: 49ms
memory: 3712kb
input:
11111 9 1107549 2691939 298974391 782710197 175975837 631858791 80573957 752268030 44807884 279200011 318005100 630132600 130445116 769329445 230959195 258196658 67434329 538628510 126840838 859267729 426717264 514655989 280881449 523731402 150265596 189142970 138881978 907208811 12171267 161288468 ...
output:
No Yes 19 26 1 12 8 14 23 7 27 25 20 17 24 3 10 4 13 22 9 11 6 18 15 5 16 21 2 Yes 18 10 23 15 6 16 19 17 21 13 11 2 20 27 26 1 12 8 3 22 7 5 4 24 14 9 25 No Yes 6 17 22 13 14 15 12 5 18 16 4 27 21 7 9 11 19 23 26 10 8 24 25 2 1 3 20 Yes 3 27 6 15 8 21 5 20 22 17 14 19 24 1 13 26 11 12 25 7 23 16 10...
result:
ok >_< (11111 test cases)
Test #11:
score: 0
Accepted
time: 48ms
memory: 3584kb
input:
10000 10 419583132 802030518 503473132 640274071 29114694 71550121 266502879 799843967 519878600 796619138 109163155 223219513 173801057 312183499 295274161 673542337 569813861 879397647 566104761 631413076 40006012 579868000 45494915 126195703 211345072 535526356 507966667 653535984 868289731 87922...
output:
No No No No No No Yes 7 9 1 15 24 2 6 8 13 5 17 27 22 19 26 12 16 30 14 3 23 21 11 25 29 4 18 20 28 10 No No No No No No No Yes 26 21 10 8 4 3 25 28 12 23 13 15 19 30 24 27 11 18 20 9 16 2 29 14 6 1 5 22 7 17 No Yes 19 9 14 8 26 27 12 25 17 3 29 13 4 15 21 6 20 7 16 24 10 11 22 30 28 2 5 1 18 23 Yes...
result:
ok >_< (10000 test cases)
Test #12:
score: 0
Accepted
time: 49ms
memory: 3584kb
input:
5000 20 248930144 452405440 28850950 509061481 11675144 16115810 46552920 66743034 250304676 677780684 13100349 208050516 401412088 954478790 27263447 387546138 341164513 641889899 343680066 717802881 119096072 661699500 675285710 759454419 90875780 255743179 294553111 694729965 146519548 862937826 ...
output:
No Yes 42 25 53 5 49 43 38 52 11 30 47 28 26 36 29 10 13 57 17 32 41 6 9 60 24 39 22 19 2 12 58 20 33 7 34 56 35 50 8 44 15 21 1 18 16 54 59 14 37 51 27 23 48 3 31 46 45 4 55 40 Yes 21 37 40 12 2 19 13 27 25 47 7 57 1 44 5 55 48 35 18 10 53 42 41 28 8 17 38 46 59 23 36 16 34 50 60 49 15 9 39 45 31 5...
result:
ok >_< (5000 test cases)
Test #13:
score: 0
Accepted
time: 53ms
memory: 3584kb
input:
2500 40 30078839 43603670 585409830 661220621 47019446 315312595 195376102 450798063 12047273 30038366 6365574 32488330 44528676 63719100 45395244 370843342 42359492 166874404 189032198 330773980 229782995 560521283 338711259 466163339 486437793 995663034 47493303 362533606 574415501 975584927 63051...
output:
Yes 21 80 5 6 92 45 1 102 75 103 7 9 22 16 114 55 31 88 30 108 64 35 107 66 27 41 18 52 3 95 19 10 70 91 14 8 42 117 109 20 100 68 84 110 37 4 106 115 12 36 73 65 17 24 33 116 78 120 105 61 71 47 85 11 81 44 46 67 34 96 25 113 53 49 90 40 72 43 63 50 2 54 97 62 58 74 112 82 104 48 38 23 79 56 99 69 ...
result:
ok >_< (2500 test cases)
Test #14:
score: 0
Accepted
time: 55ms
memory: 3712kb
input:
2000 50 167005 134170081 119263013 235040736 359376356 405102476 368254760 567954026 142560899 351391400 52465572 872095141 5895182 116079799 503946453 935104039 624910603 779623552 407602577 857355273 104834774 642352783 377070248 394389351 7487217 10847154 78697148 403727586 19118138 104520573 302...
output:
No Yes 74 110 37 90 12 27 127 129 18 9 106 117 149 2 79 115 42 77 46 143 67 71 98 145 75 66 54 88 23 39 124 32 68 102 56 70 105 47 80 94 91 139 130 134 25 113 20 4 111 3 53 112 33 147 100 81 69 114 84 137 96 109 62 60 10 58 36 108 150 11 121 5 119 45 22 16 78 38 123 95 59 35 72 140 31 1 63 50 116 92...
result:
ok >_< (2000 test cases)
Test #15:
score: 0
Accepted
time: 58ms
memory: 3840kb
input:
200 500 240044454 570226789 326748706 906240738 59915230 229227123 25870484 122983289 308323481 491439677 331521117 542348836 79780138 236140577 37215732 400441450 491421004 505626478 41928148 79419397 196402648 681911017 108323645 778854244 168295325 331859787 204653768 764539434 3525633 67848640 2...
output:
Yes 739 426 912 78 1103 243 1125 184 379 254 27 1094 96 1084 1038 99 1228 451 332 661 980 314 1062 377 595 452 609 1213 522 605 68 1162 1253 1168 370 1270 197 854 1347 585 235 1114 1286 473 1333 1194 756 1452 1294 835 761 478 838 689 1497 1132 650 842 1418 248 122 691 1013 1185 834 483 390 1182 259 ...
result:
ok >_< (200 test cases)
Test #16:
score: 0
Accepted
time: 63ms
memory: 4112kb
input:
20 5000 239015031 756662829 107482861 164615679 141286392 176745065 711024070 930641599 203753862 992714840 535460189 890646201 120990575 828015603 80241903 245741385 71064502 937343509 255954224 804090603 241085164 265947390 573467935 767999938 9086606 20283091 44079769 135162900 195630455 72443138...
output:
Yes 782 10270 5391 7067 2315 12414 13464 523 5348 4336 12517 4925 6636 14692 13106 10807 2325 6756 13049 10715 14132 11495 9082 4235 9235 6096 1931 14188 5268 11842 11606 7318 7887 13239 14825 7899 3386 8334 5605 224 1935 10282 7373 14682 11137 9590 9904 1606 14372 6172 4178 11189 2200 13791 11420 9...
result:
ok >_< (20 test cases)
Test #17:
score: 0
Accepted
time: 50ms
memory: 7820kb
input:
2 50000 134099372 138717692 88497176 203623137 28400878 531963161 491599270 508595246 656123949 690513632 506593350 840717696 75151479 190312317 138082662 708771391 441148125 893057843 452806396 741239078 42068396 78667991 585159549 926735558 695533088 854308946 676238139 709752322 416586658 6449615...
output:
No No
result:
ok >_< (2 test cases)
Test #18:
score: 0
Accepted
time: 78ms
memory: 13696kb
input:
1 100000 168698075 217141764 51605261 710454586 17380477 789075415 570367 24849107 469495633 685675008 559954719 839804815 332883788 638763480 12087643 327755609 8406881 43827967 108436258 390187172 266381263 301370841 563550486 622696676 204362703 598237196 218501304 232099091 198720699 211987715 7...
output:
Yes 256556 168460 104318 223132 54783 185038 138877 285307 113271 190167 119294 131392 42602 177081 10206 171507 94428 135424 178849 260297 152820 101955 276798 10541 107547 6942 130237 211032 112260 257523 286195 110233 231361 160244 123607 241652 99138 82840 178241 65216 157695 105354 3245 112726 ...
result:
ok >_< (1 test case)
Test #19:
score: 0
Accepted
time: 59ms
memory: 3840kb
input:
333 300 499999940 500000540 499999880 500000480 499999882 500000482 500000108 500000110 499999706 500000306 500000286 500000288 499999742 500000342 500000500 500000502 499999773 500000373 500000184 500000186 500000090 500000092 500000010 500000012 499999640 500000240 499999830 500000430 499999945 50...
output:
Yes 821 637 670 347 462 719 597 407 655 834 298 761 611 625 810 369 668 12 343 18 616 182 475 473 264 483 661 98 29 512 69 762 43 334 175 176 480 844 33 437 345 171 84 249 647 537 500 833 123 609 211 419 622 141 234 82 213 575 656 144 199 466 709 588 672 36 147 71 49 645 394 97 148 460 362 350 775 1...
result:
ok >_< (333 test cases)
Test #20:
score: 0
Accepted
time: 72ms
memory: 4112kb
input:
20 5000 500004916 500004918 499994554 500004554 499994653 500004653 500008346 500008348 499990052 500000052 499998337 500008337 499991225 500001225 500008078 500008080 500001210 500001212 500008800 500008802 499992103 500002103 500007998 500008000 500006906 500006908 499994207 500004207 500009454 50...
output:
Yes 1261 4516 6121 11213 9936 13475 11449 9949 4618 13570 4104 1394 9258 7823 13754 5431 10161 4238 5289 9102 1691 12872 13516 3068 582 14026 8804 2910 13492 8581 9484 208 2754 9342 1167 10154 10666 9447 6959 10028 13070 14935 8088 7701 12807 8819 4902 13283 13441 4223 13557 14554 886 9076 2128 2416...
result:
ok >_< (20 test cases)
Test #21:
score: 0
Accepted
time: 70ms
memory: 4448kb
input:
10 10000 499997582 500017582 499994226 500014226 499999146 500019146 499986192 500006192 500006688 500006690 500005454 500005456 500012694 500012696 499994423 500014423 500018252 500018254 499984238 500004238 500019624 500019626 500002666 500002668 499981309 500001309 499984412 500004412 499989582 5...
output:
Yes 7133 3571 2784 21093 7744 2889 5592 14515 16631 17082 23969 19725 12741 11488 24164 8185 15427 27110 10657 26263 11891 21721 22169 13925 7000 5158 27632 25335 29844 7938 29520 16020 27453 23705 11007 28622 26145 20675 22235 11116 26583 4796 22975 27261 23356 17604 6493 2902 6303 4523 5639 11461 ...
result:
ok >_< (10 test cases)
Test #22:
score: 0
Accepted
time: 76ms
memory: 13756kb
input:
1 100000 500195974 500195976 499821737 500021737 500032078 500032080 499844833 500044833 500004644 500004646 499896575 500096575 499837203 500037203 500162180 500162182 499803443 500003443 499903390 500103390 499997619 500197619 499983152 500183152 499851444 500051444 500124540 500124542 500090666 5...
output:
Yes 264885 131511 65139 226045 76576 124455 244544 83964 221144 82996 80178 264786 238107 74430 167762 171984 293393 200062 13739 250735 221633 60795 171343 214704 232225 291395 277188 298732 19408 52446 42025 13088 135362 149955 182674 116134 89109 25559 229441 197236 103652 46839 44499 245551 7280...
result:
ok >_< (1 test case)
Test #23:
score: 0
Accepted
time: 56ms
memory: 3584kb
input:
333 300 499999677 500000277 499999937 500000537 499999927 500000527 500000186 500000187 500000577 500000580 499999970 500000570 499999688 500000288 499999779 500000379 499999825 500000425 500000503 500000506 499999429 500000029 499999795 500000395 500000251 500000254 499999853 500000453 499999792 50...
output:
No Yes 595 615 528 457 108 338 732 357 59 484 153 433 500 687 408 872 788 567 250 506 101 563 442 358 214 239 85 553 161 424 900 635 261 831 636 20 722 730 657 34 121 829 140 806 609 287 36 873 52 3 400 498 410 309 92 325 97 53 342 777 649 199 507 772 278 479 460 177 62 458 697 91 600 560 74 895 515...
result:
ok >_< (333 test cases)
Test #24:
score: 0
Accepted
time: 76ms
memory: 13696kb
input:
1 100000 500191010 500191012 499836328 500036328 499951243 500151243 499935598 500135598 499898653 500098653 499956171 500156171 500101528 500101529 499800616 500000616 500107541 500107543 500158180 500158181 499825597 500025597 500175739 500175742 500076543 500076545 499970418 500170418 500014716 5...
output:
Yes 133749 185289 8827 131627 243919 142806 78069 216300 277867 257868 265642 128874 242428 35978 101065 173722 14900 255534 239643 152359 173490 192333 249724 147928 10842 27661 197591 95794 149171 178375 227306 270097 199144 285165 91148 266432 121891 63655 68961 220577 126038 46166 298277 31828 1...
result:
ok >_< (1 test case)
Extra Test:
score: 0
Extra Test Passed