QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#111589 | #6511. Balancing Sequences | ExplodingKonjac | AC ✓ | 78ms | 3784kb | C++14 | 5.4kb | 2023-06-07 16:57:50 | 2023-06-07 16:57:52 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
// #define OPENIOBUF
namespace FastIO
{
class FastIOBase
{
protected:
#ifdef OPENIOBUF
static const int BUFSIZE=1<<16;
char buf[BUFSIZE+1];
int buf_p=0;
#endif
FILE *target;
FastIOBase(FILE *f): target(f){}
~FastIOBase()=default;
public:
#ifdef OPENIOBUF
virtual void flush()=0;
#endif
};
class FastOutput final: public FastIOBase
{
#ifdef OPENIOBUF
public:
inline void flush()
{ fwrite(buf,1,buf_p,target),buf_p=0; }
#endif
private:
inline void __putc(char x)
{
#ifdef OPENIOBUF
if(buf[buf_p++]=x,buf_p==BUFSIZE) flush();
#else
putc(x,target);
#endif
}
template<typename T>
inline void __write(T x)
{
char stk[64],*top=stk;
if(x<0) return __putc('-'),__write(-x);
do *(top++)=x%10,x/=10; while(x);
for(;top!=stk;__putc(*(--top)+'0'));
}
public:
FastOutput(FILE *f=stdout): FastIOBase(f){}
#ifdef OPENIOBUF
~FastOutput(){ flush(); }
#endif
inline FastOutput &operator <<(char x)
{ return __putc(x),*this; }
inline FastOutput &operator <<(const char *s)
{ for(;*s;__putc(*(s++)));return *this; }
inline FastOutput &operator <<(const string &s)
{ return (*this)<<s.c_str(); }
template<typename T>
inline enable_if_t<is_integral<T>::value,FastOutput&> operator <<(const T &x)
{ return __write(x),*this; }
template<typename ...T>
inline void writesp(const T &...x)
{ initializer_list<int>{(this->operator<<(x),__putc(' '),0)...}; }
template<typename ...T>
inline void writeln(const T &...x)
{ initializer_list<int>{(this->operator<<(x),__putc('\n'),0)...}; }
template<typename Iter>
inline void writesp(Iter begin,Iter end)
{ while(begin!=end) (*this)<<*(begin++)<<' '; }
template<typename Iter>
inline void writeln(Iter begin,Iter end)
{ while(begin!=end) (*this)<<*(begin++)<<'\n'; }
}qout;
class FastInput final: public FastIOBase
{
#ifdef OPENIOBUF
public:
inline void flush()
{ buf[fread(buf,1,BUFSIZE,target)]=EOF,buf_p=0; }
#endif
private:
bool __eof;
inline char __getc()
{
if(__eof) return EOF;
#ifdef OPENIOBUF
if(buf_p==BUFSIZE) flush();
char ch=buf[buf_p++];
#else
char ch=getc(target);
#endif
return ~ch?ch:(__eof=true,EOF);
}
inline void __ungetc(char c)
{
__eof=false;
#ifdef OPENIOBUF
buf_p--;
#else
ungetc(c,target);
#endif
}
public:
FastInput(FILE *f=stdin): FastIOBase(f),__eof(false)
#ifdef OPENIOBUF
{ buf_p=BUFSIZE; }
inline bool eof()const { return buf[buf_p]==EOF; }
#else
{}
inline bool eof()const { return feof(target); }
#endif
inline char peek() { return __getc(); }
explicit inline operator bool()const { return !__eof; }
inline FastInput &operator >>(char &x)
{ while(isspace(x=__getc()));return *this; }
template<typename T>
inline enable_if_t<is_integral<T>::value,FastInput&> operator >>(T &x)
{
char ch,sym=0;x=0;
while(isspace(ch=__getc()));
if(__eof) return *this;
if(ch=='-') sym=1,ch=__getc();
for(x=0;isdigit(ch);x=(x<<1)+(x<<3)+(ch^48),ch=__getc());
return __ungetc(ch),sym?x=-x:x,*this;
}
inline FastInput &operator >>(char *s)
{
while(isspace(*s=__getc()));
if(__eof) return *this;
for(;!isspace(*s) && !__eof;*(++s)=__getc());
return __ungetc(*s),*s='\0',*this;
}
inline FastInput &operator >>(string &s)
{
char str_buf[(1<<8)+1]={0},*p=str_buf;
char *const buf_end=str_buf+(1<<8);
while(isspace(*p=__getc()));
if(__eof) return *this;
for(s.clear(),p++;;p=str_buf)
{
for(;p!=buf_end && !isspace(*p=__getc()) && !__eof;p++);
if(p!=buf_end) break;
s.append(str_buf);
}
__ungetc(*p),*p='\0',s.append(str_buf);
return *this;
}
template<typename ...T>
inline void read(T &...x)
{ initializer_list<int>{(this->operator>>(x),0)...}; }
template<typename Iter>
inline void read(Iter begin,Iter end)
{ while(begin!=end) (*this)>>*(begin++); }
}qin;
} // namespace FastIO
using FastIO::qin,FastIO::qout;
using LL=long long;
using LD=long double;
using UI=unsigned int;
using ULL=unsigned long long;
#ifndef DADALZY
#define FILEIO(file) freopen(file".in","r",stdin),freopen(file".out","w",stdout)
#else
#define FILEIO(file)
#endif
using Point=array<int,2>;
int T,n,a[2][2005],b[2][2005];
Point pa[4005],pb[4005];
#define NO_IF(cond) { if(cond) { qout<<"-1\n";goto clear_all_data; } }
vector<pair<Point,Point>> ans;
inline bool check(Point p)
{
return a[p[0]][p[1]]>a[p[0]^1][p[1]];
}
inline bool pushAns(Point p1,Point p2)
{
if(!check(p1) || !check(p2)) return false;
ans.emplace_back(p1,p2);
int &x=a[p1[0]][p1[1]],&y=a[p2[0]][p2[1]];
swap(x,y),swap(pa[x],pa[y]);
return true;
}
int main()
{
qin>>T;
while(T--)
{
qin>>n;
for(int k: {0,1}) qin.read(a[k]+1,a[k]+n+1);
for(int k: {0,1}) qin.read(b[k]+1,b[k]+n+1);
for(int k: {0,1}) for(int i=1;i<=n;i++)
{
pa[a[k][i]]=Point{k,i};
pb[b[k][i]]=Point{k,i};
}
for(int i=1;i<=2*n;i++)
{
Point now=pa[i],nxt=pb[i];
if(now==nxt || pushAns(now,nxt)) continue;
NO_IF(!check(now));
int mn=1e9;
for(int j=i+1;j<=2*n;j++)
if(check(pa[j])) mn=min(mn,j);
NO_IF(mn>2*n);
nxt[0]^=1,pushAns(nxt,pa[mn]),nxt[0]^=1;
NO_IF(!pushAns(now,nxt));
assert(pa[i]==pb[i]);
}
qout<<ans.size()<<'\n';
for(auto &[x,y]: ans)
{
qout<<(x[0]+1)<<' '<<x[1]<<' ';
qout<<(y[0]+1)<<' '<<y[1]<<'\n';
}
clear_all_data: ans.clear();
}
return 0;
}
/*
1
3
4 6 2
1 5 3
6 4 2
1 3 5
*/
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 2ms
memory: 3432kb
input:
2 2 1 2 3 4 4 3 2 1 3 1 2 4 3 5 6 1 2 4 5 3 6
output:
-1 1 2 1 2 2
result:
ok correct plan (nYES = 1, nNO = 1) (2 test cases)
Test #2:
score: 0
Accepted
time: 30ms
memory: 3564kb
input:
100000 3 1 6 4 2 3 5 5 6 1 3 4 2 3 3 5 2 6 1 4 4 3 5 6 2 1 3 6 4 3 2 5 1 1 4 5 2 3 6 3 4 2 3 6 1 5 3 1 4 5 2 6 3 4 3 1 5 2 6 4 3 6 5 1 2 3 1 5 6 3 2 4 2 3 5 6 1 4 3 2 5 4 6 1 3 6 3 2 5 4 1 3 3 6 5 2 1 4 3 5 4 2 6 1 3 5 6 3 2 4 1 3 4 6 2 5 1 3 4 5 6 2 3 1 1 2 3 4 6 5 3 3 2 1 6 4 5 3 1 5 2 4 6 3 5 2 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 4 1 3 1 1 1 2 2 3 1 3 1 1 1 2 1 3 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 2 3 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 2 2 1 1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 ...
result:
ok correct plan (nYES = 1646, nNO = 98354) (100000 test cases)
Test #3:
score: 0
Accepted
time: 49ms
memory: 3408kb
input:
100000 4 8 4 5 2 7 3 6 1 5 1 6 4 3 7 8 2 4 4 1 7 6 5 2 8 3 3 2 8 5 6 1 4 7 4 8 1 4 2 3 7 6 5 5 2 1 7 4 8 6 3 4 1 5 3 6 2 7 8 4 3 4 2 6 5 8 1 7 4 8 1 6 3 5 2 7 4 4 6 2 8 5 3 7 1 4 8 7 6 1 2 5 4 3 2 7 1 4 3 8 6 5 4 7 4 8 5 1 2 6 3 5 3 4 2 8 6 7 1 4 5 4 8 3 1 7 2 6 3 8 7 2 6 5 1 4 4 3 8 1 2 5 7 4 6 6 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 correct plan (nYES = 292, nNO = 99708) (100000 test cases)
Test #4:
score: 0
Accepted
time: 49ms
memory: 3560kb
input:
100000 5 4 5 10 1 2 6 9 7 3 8 4 8 5 3 6 2 10 7 1 9 5 6 10 4 8 3 7 9 1 5 2 1 6 8 2 10 3 5 4 7 9 5 3 6 2 8 9 10 7 4 5 1 8 10 3 6 2 5 1 4 7 9 5 6 1 9 4 2 3 10 7 5 8 3 6 8 1 9 4 5 7 10 2 5 8 6 1 2 4 7 10 5 9 3 7 10 9 1 3 6 8 5 4 2 5 1 5 3 9 7 4 2 8 10 6 6 2 1 9 7 8 5 4 10 3 5 9 4 10 8 3 1 6 7 5 2 7 10 2...
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 correct plan (nYES = 51, nNO = 99949) (100000 test cases)
Test #5:
score: 0
Accepted
time: 57ms
memory: 3560kb
input:
100000 6 12 11 10 7 8 1 3 4 2 6 9 5 2 4 12 10 8 9 6 3 7 11 1 5 6 4 10 1 3 7 6 9 5 2 8 11 12 2 3 5 8 12 10 6 9 11 4 7 1 6 4 1 11 3 8 6 5 12 10 2 7 9 8 1 10 12 3 2 4 5 11 7 9 6 6 10 3 1 5 8 11 9 6 12 7 2 4 4 8 5 2 6 3 1 12 7 10 11 9 6 11 6 8 2 12 1 4 10 7 5 3 9 8 10 2 1 12 7 9 5 3 4 6 11 6 7 1 5 6 9 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 correct plan (nYES = 13, nNO = 99987) (100000 test cases)
Test #6:
score: 0
Accepted
time: 31ms
memory: 3472kb
input:
10000 20 15 26 22 6 17 32 24 29 16 8 9 27 25 28 7 11 2 40 3 14 38 13 20 31 30 33 35 10 39 4 23 1 36 21 18 19 12 34 37 5 22 34 6 30 25 31 20 28 14 37 13 2 32 1 35 27 10 11 38 8 26 39 4 19 33 29 17 40 5 21 15 7 23 16 3 24 18 9 12 36 20 16 21 19 3 36 25 2 22 23 26 12 34 9 33 14 24 40 28 35 1 13 32 4 10...
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 correct plan (nYES = 0, nNO = 10000) (10000 test cases)
Test #7:
score: 0
Accepted
time: 2ms
memory: 3408kb
input:
1 2000 3210 3824 856 2261 3740 2833 1675 1387 380 689 1915 1152 1129 1416 145 3845 1211 1450 1328 2069 2649 347 1193 2904 2517 1373 2346 2610 1094 2736 3821 953 3997 3776 1041 539 1516 2739 129 995 1886 2201 1563 1039 173 1566 1286 2336 3283 3473 1550 2664 2854 1778 3419 2394 921 58 1500 1980 1771 5...
output:
-1
result:
ok correct plan (nYES = 0, nNO = 1) (1 test case)
Test #8:
score: 0
Accepted
time: 32ms
memory: 3392kb
input:
100000 3 1 6 4 2 3 5 1 2 4 6 5 3 3 5 3 6 1 4 2 4 3 6 1 5 2 3 3 2 4 1 5 6 3 2 4 1 6 5 3 4 5 6 2 3 1 4 5 6 2 3 1 3 3 5 4 6 2 1 3 6 5 4 2 1 3 4 3 5 2 1 6 3 5 6 2 1 4 3 2 1 3 5 6 4 2 1 3 4 6 5 3 5 4 2 6 1 3 5 4 2 6 1 3 3 1 3 5 2 4 6 1 3 6 4 5 2 3 1 4 5 2 3 6 1 4 5 6 3 2 3 6 2 1 5 4 3 4 2 1 3 5 6 3 1 3 2...
output:
2 2 1 1 2 2 2 2 3 1 2 2 1 1 1 2 2 2 3 0 2 1 3 2 1 1 2 1 3 3 1 2 1 1 1 2 2 3 1 3 1 2 1 2 3 2 1 0 3 2 1 2 3 2 2 2 1 1 3 2 2 1 2 1 2 3 3 1 1 2 2 2 3 2 1 2 3 2 2 1 2 1 2 3 1 1 3 2 1 2 2 3 1 1 2 2 2 3 0 0 1 2 3 1 2 2 1 1 2 2 1 1 2 3 2 1 2 1 3 1 2 1 1 2 1 1 1 2 1 1 2 3 0 1 1 2 1 3 1 1 2 1 3 1 1 3 2 2 2 1 ...
result:
ok correct plan (nYES = 100000, nNO = 0) (100000 test cases)
Test #9:
score: 0
Accepted
time: 61ms
memory: 3388kb
input:
100000 4 8 4 5 2 7 3 6 1 6 7 5 2 8 3 4 1 4 3 6 5 2 4 1 7 8 3 8 5 2 4 1 7 6 4 2 7 1 8 4 6 5 3 2 5 1 4 8 6 7 3 4 1 2 8 7 5 3 4 6 1 2 3 4 5 8 7 6 4 8 1 5 7 4 6 2 3 8 1 7 6 4 5 2 3 4 1 3 8 7 5 6 2 4 1 3 8 7 5 6 2 4 4 5 7 3 2 8 6 1 4 5 3 4 2 8 7 1 6 4 4 5 3 2 7 6 8 1 4 5 3 2 6 7 8 1 4 4 6 3 5 8 1 2 7 4 8...
output:
3 1 2 2 3 1 2 1 1 2 1 1 2 1 1 2 2 4 2 2 1 1 4 2 3 1 2 2 2 2 1 3 2 3 1 4 2 1 3 2 2 1 3 1 4 0 3 1 3 1 2 2 4 1 3 2 2 2 4 1 2 2 2 1 1 1 2 2 1 1 1 3 2 4 4 2 4 1 1 2 1 2 4 2 1 2 3 1 3 2 1 2 2 1 2 2 2 4 2 1 3 1 4 2 3 1 2 1 3 1 1 1 2 2 2 3 1 1 2 3 2 2 3 2 1 1 4 2 2 2 1 2 2 2 3 4 2 1 2 4 1 4 2 1 2 3 1 2 1 4 ...
result:
ok correct plan (nYES = 100000, nNO = 0) (100000 test cases)
Test #10:
score: 0
Accepted
time: 70ms
memory: 3440kb
input:
100000 5 4 5 10 1 2 6 9 7 3 8 9 5 6 1 2 3 4 7 10 8 5 4 10 5 6 1 3 7 8 9 2 2 4 5 6 1 3 8 9 10 7 5 4 8 3 1 9 7 6 2 10 5 4 9 5 1 3 10 6 2 8 7 5 1 8 9 6 7 2 5 10 4 3 1 7 4 2 10 9 5 8 6 3 5 7 5 2 8 3 4 1 9 10 6 10 8 2 6 3 4 1 7 9 5 5 7 9 2 8 5 3 1 4 10 6 9 10 2 8 5 3 1 7 6 4 5 5 10 8 2 1 6 9 3 4 7 5 6 9 ...
output:
3 2 4 2 1 1 1 2 2 2 4 1 3 5 2 5 1 1 2 5 1 2 2 2 2 5 2 3 2 2 2 4 2 3 5 1 3 1 5 2 5 1 3 2 1 2 5 1 2 2 4 2 1 1 2 7 2 1 1 4 2 3 2 1 2 4 1 3 2 3 2 4 1 5 1 2 1 5 2 3 1 5 2 1 4 1 2 2 5 2 4 1 1 1 2 1 4 2 4 2 3 4 2 3 2 5 2 3 2 4 1 1 2 3 1 2 1 1 3 2 1 1 2 1 3 2 1 2 2 1 3 4 1 4 2 1 1 4 2 2 1 4 2 5 1 5 1 3 4 2 ...
result:
ok correct plan (nYES = 100000, nNO = 0) (100000 test cases)
Test #11:
score: 0
Accepted
time: 59ms
memory: 3560kb
input:
62500 8 6 11 5 9 4 16 15 12 2 13 1 3 7 8 14 10 16 11 14 13 4 9 12 6 2 5 1 3 7 8 15 10 8 13 16 10 2 4 15 11 6 8 14 7 1 3 9 5 12 4 12 6 10 9 8 14 15 11 13 16 1 3 7 5 2 8 15 11 16 6 14 9 5 2 12 1 4 3 8 10 7 13 10 6 7 12 13 9 5 2 16 1 4 3 8 15 11 14 8 8 2 6 7 3 1 9 4 15 13 5 10 14 16 12 11 8 2 15 7 3 1 ...
output:
7 1 3 2 2 1 1 1 8 1 4 1 6 1 1 1 7 1 3 1 4 2 7 1 3 1 1 2 7 12 1 4 2 8 1 5 1 1 1 8 1 3 1 6 2 1 2 3 2 6 2 3 1 5 1 8 1 4 1 7 2 1 1 8 1 2 2 3 2 2 2 3 1 7 2 3 1 8 6 1 4 1 2 2 7 1 3 2 6 1 1 1 4 2 7 2 1 1 4 2 8 1 5 7 1 3 2 7 1 7 2 4 1 7 2 6 2 8 2 2 1 3 2 1 2 8 2 5 2 8 1 7 7 2 1 2 5 1 4 2 2 1 8 2 7 2 6 2 8 2...
result:
ok correct plan (nYES = 62500, nNO = 0) (62500 test cases)
Test #12:
score: 0
Accepted
time: 78ms
memory: 3436kb
input:
40000 10 15 9 20 10 7 17 2 19 18 4 16 6 3 14 12 5 11 8 13 1 9 19 14 10 7 18 2 15 4 12 13 6 3 17 16 5 11 8 20 1 10 5 13 17 1 20 14 18 7 12 11 9 19 16 4 15 6 8 10 2 3 5 9 11 1 15 16 4 7 14 18 12 10 13 20 8 6 19 17 2 3 10 4 6 19 8 18 7 17 15 5 2 11 12 16 3 14 9 10 1 13 20 4 6 9 13 17 7 20 16 5 2 19 11 ...
output:
11 1 10 1 9 2 1 2 7 1 2 1 1 2 1 2 7 2 5 1 10 2 9 2 1 2 4 1 3 1 2 1 8 2 9 2 5 1 6 2 4 2 9 1 6 14 2 4 1 7 1 5 2 1 2 7 2 5 2 2 2 8 1 5 1 2 1 10 1 3 1 9 2 1 1 5 2 3 1 6 1 9 2 7 1 5 2 7 1 6 1 10 2 8 2 4 1 10 2 4 2 7 12 1 5 2 6 1 4 2 5 1 5 1 3 2 1 2 2 2 1 2 9 2 1 1 4 2 1 2 3 1 8 2 6 2 1 1 8 1 7 1 5 2 1 2 ...
result:
ok correct plan (nYES = 40000, nNO = 0) (40000 test cases)
Test #13:
score: 0
Accepted
time: 58ms
memory: 3396kb
input:
10000 20 15 26 22 6 17 32 24 29 16 8 9 27 25 28 7 11 2 40 3 14 38 13 20 31 30 33 35 10 39 4 23 1 36 21 18 19 12 34 37 5 15 12 18 6 17 32 30 13 16 28 40 27 14 20 7 11 2 9 3 33 25 24 37 36 26 21 23 10 31 4 8 1 29 39 19 22 38 35 34 5 20 17 1 39 27 13 25 12 3 35 21 28 33 16 29 22 40 20 19 8 6 32 37 10 9...
output:
24 1 10 2 11 1 11 1 18 2 17 1 2 2 2 1 8 2 13 2 15 1 20 1 13 2 13 1 3 2 16 2 15 2 3 1 14 2 14 2 6 2 13 2 16 1 10 2 7 1 7 2 2 1 20 2 1 2 17 2 5 2 3 1 10 1 7 2 13 2 17 1 7 2 4 2 9 2 14 1 20 2 18 2 19 2 3 2 18 2 17 2 4 2 14 2 17 22 1 8 2 13 1 16 1 13 1 7 2 16 1 16 2 17 2 20 1 3 1 18 2 6 1 17 2 14 1 15 1...
result:
ok correct plan (nYES = 10000, nNO = 0) (10000 test cases)
Test #14:
score: 0
Accepted
time: 31ms
memory: 3568kb
input:
2500 40 20 66 71 79 65 73 42 2 27 63 16 35 45 56 49 52 1 24 78 5 21 15 47 80 68 64 54 11 13 26 39 50 77 29 72 75 62 53 23 30 14 8 51 6 28 67 12 18 70 61 17 34 41 10 59 36 43 9 46 33 74 37 25 40 19 57 31 48 22 55 76 7 4 60 69 58 38 44 32 3 44 53 45 57 17 35 59 2 27 24 16 38 28 69 48 33 1 67 22 5 21 1...
output:
54 2 11 1 5 1 35 1 1 2 8 2 35 1 35 1 36 2 29 1 19 1 18 1 10 2 5 1 13 1 40 2 15 1 37 2 20 2 39 2 37 1 37 1 16 1 12 1 6 2 16 1 26 1 38 2 39 2 22 2 38 1 38 1 12 2 13 1 27 1 7 1 35 2 17 1 23 2 22 1 1 2 5 1 3 2 19 2 9 2 17 1 37 2 28 1 15 2 28 2 30 1 32 2 29 2 3 2 6 2 17 1 38 2 39 1 2 2 13 1 33 2 28 2 31 ...
result:
ok correct plan (nYES = 2500, nNO = 0) (2500 test cases)
Test #15:
score: 0
Accepted
time: 25ms
memory: 3568kb
input:
1600 50 19 11 69 62 13 54 23 56 65 83 21 17 95 91 9 100 48 18 22 53 74 3 59 5 27 36 16 58 50 80 68 78 42 88 73 6 10 15 35 67 28 81 38 43 72 76 29 84 1 45 44 99 32 79 4 71 8 47 87 52 89 93 96 77 86 37 57 30 55 64 46 25 7 92 90 33 70 97 66 31 40 85 12 94 24 20 39 82 51 41 2 26 61 75 49 98 63 60 14 34 ...
output:
63 1 5 1 50 2 49 2 46 2 36 1 14 1 7 2 28 2 29 1 41 2 22 1 29 2 29 2 44 2 18 2 43 2 50 2 9 1 26 1 48 1 43 1 10 2 37 2 6 1 33 1 45 2 4 2 1 1 44 1 4 2 4 1 21 1 5 2 17 2 21 2 20 1 17 2 38 2 45 2 37 2 22 2 32 2 39 2 34 2 10 2 13 1 20 1 8 1 6 2 4 2 19 1 42 1 20 1 13 1 5 1 32 1 28 1 3 2 48 1 30 2 18 1 40 2...
result:
ok correct plan (nYES = 1600, nNO = 0) (1600 test cases)
Test #16:
score: 0
Accepted
time: 14ms
memory: 3488kb
input:
400 100 180 101 194 36 166 121 61 174 94 153 40 140 102 96 93 68 145 24 16 85 183 55 172 176 181 198 45 81 158 165 99 132 12 29 182 125 190 52 129 141 113 46 189 120 138 199 130 167 106 196 136 78 76 127 13 43 123 144 30 108 82 114 60 35 1 142 8 32 200 86 70 112 155 192 31 119 73 20 90 14 39 168 69 ...
output:
141 2 84 1 51 2 47 2 81 1 85 1 47 2 47 1 49 2 40 2 42 2 49 1 40 2 40 2 71 2 18 1 24 2 66 2 67 2 4 1 66 1 50 2 7 2 66 2 50 1 50 1 93 1 71 2 17 2 59 2 28 2 75 1 82 1 26 1 53 2 93 2 26 1 26 1 44 1 43 2 51 2 63 2 43 1 43 1 48 2 95 2 80 1 28 1 95 2 95 2 57 1 20 1 74 1 70 2 14 2 31 2 82 2 55 1 31 1 10 1 7...
result:
ok correct plan (nYES = 400, nNO = 0) (400 test cases)
Test #17:
score: 0
Accepted
time: 11ms
memory: 3492kb
input:
100 200 276 115 118 75 252 391 300 241 341 172 95 30 134 371 53 261 218 328 70 169 312 189 379 381 107 262 273 398 187 329 123 212 207 364 184 269 229 277 331 347 197 225 320 236 230 351 296 213 182 268 32 186 37 29 369 34 168 202 346 46 198 265 377 10 290 193 148 224 180 393 233 65 114 167 50 397 2...
output:
274 1 146 2 172 2 143 1 6 1 24 1 172 2 54 2 24 1 24 1 94 2 117 2 42 2 106 1 63 2 104 2 72 2 15 1 104 2 104 2 137 2 6 2 67 2 75 1 9 2 158 1 165 2 4 2 120 1 99 2 87 2 130 1 198 1 73 1 130 2 130 2 66 2 60 1 18 1 183 1 13 2 92 2 183 1 183 1 101 1 188 2 57 2 131 2 141 2 101 2 68 2 43 1 168 2 78 1 43 2 43...
result:
ok correct plan (nYES = 100, nNO = 0) (100 test cases)
Test #18:
score: 0
Accepted
time: 2ms
memory: 3612kb
input:
16 500 937 228 200 167 830 159 627 860 548 749 95 747 312 999 138 101 541 896 699 647 646 279 360 707 890 822 425 441 852 96 526 899 585 701 223 321 264 934 595 267 259 772 81 178 339 557 163 677 359 343 779 738 838 106 516 121 338 191 345 579 295 650 663 470 485 388 293 500 135 364 532 949 496 263 ...
output:
758 1 80 1 229 1 340 2 4 2 209 1 131 2 236 2 309 1 427 2 285 1 81 1 486 2 470 1 495 1 309 1 329 1 43 2 203 2 413 1 317 1 264 2 71 2 152 1 92 1 285 2 157 1 56 2 415 2 459 2 345 1 69 2 212 1 415 1 337 2 131 2 64 2 317 1 105 1 360 1 47 2 398 2 360 2 241 2 92 1 360 1 241 2 241 1 116 1 4 1 267 2 141 1 16...
result:
ok correct plan (nYES = 16, nNO = 0) (16 test cases)
Test #19:
score: 0
Accepted
time: 2ms
memory: 3524kb
input:
4 1000 1506 1787 219 1614 1499 427 1175 1054 871 492 1115 1522 1028 1761 997 177 1086 1942 1821 1351 100 20 1128 1222 1606 1291 952 1495 816 888 841 462 113 1871 652 1519 764 208 1009 849 1061 1660 655 1133 114 1899 838 982 1038 1742 1011 1692 542 636 119 647 530 194 1215 1471 1224 506 1107 1642 171...
output:
1512 2 980 2 374 2 449 2 905 2 210 1 669 2 221 2 589 1 262 1 445 1 501 1 144 1 809 2 937 2 354 1 212 1 111 1 354 2 354 1 387 2 144 1 32 2 32 2 949 2 261 1 1000 1 38 1 673 2 613 2 911 2 76 2 101 2 321 2 203 1 663 2 630 1 757 2 663 1 663 1 624 2 705 1 384 1 779 2 855 2 445 2 318 2 713 2 676 2 795 1 71...
result:
ok correct plan (nYES = 4, nNO = 0) (4 test cases)
Test #20:
score: 0
Accepted
time: 3ms
memory: 3784kb
input:
1 2000 3210 3824 856 2261 3740 2833 1675 1387 380 689 1915 1152 1129 1416 145 3845 1211 1450 1328 2069 2649 347 1193 2904 2517 1373 2346 2610 1094 2736 3821 953 3997 3776 1041 539 1516 2739 129 995 1886 2201 1563 1039 173 1566 1286 2336 3283 3473 1550 2664 2854 1778 3419 2394 921 58 1500 1980 1771 5...
output:
2979 1 1574 2 622 1 1307 2 1497 2 687 2 123 1 987 1 141 1 455 1 1009 1 1256 2 280 2 596 2 1813 2 1408 2 17 1 1419 1 98 1 685 1 1633 1 1720 2 685 1 685 2 295 1 102 1 641 2 121 2 1010 1 1438 1 398 1 829 2 319 2 1245 1 802 1 280 2 207 1 1644 2 63 1 614 1 1003 2 1016 2 1821 2 633 2 453 2 1012 1 1308 2 1...
result:
ok correct plan (nYES = 1, nNO = 0) (1 test case)