QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#137703#4218. Hidden GraphXY_ElevenRE 72ms5992kbC++234.4kb2023-08-10 16:44:382023-08-10 16:44:40

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-08-10 16:44:40]
  • 评测
  • 测评结果:RE
  • 用时:72ms
  • 内存:5992kb
  • [2023-08-10 16:44:38]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define DB double
#define LL long long
#define ULL unsigned long long
#define pii pair<int,int>
#define pil pair<int,LL>
#define mii map<int,int>
#define miig map<int,int,greater<int> >
#define mil map<int,LL>
#define in128 __int128
#define cint const int
#define cLL const LL
#define cDB const DB
#define cchar const char
#define invoid inline void
#define inLL inline LL
#define inlint inline int
#define inbool inline bool
#define inl128 inline __int128
#define inDB inline double
#define For(z,e1,e2) for(int z=(e1);z<=(e2);z++)
#define Rof(z,e1,e2) for(int z=(e2);z>=(e1);z--)
#define For_(z,e1,e2) for(int z=(e1);z<(e2);z++)
#define Rof_(z,e1,e2) for(int z=(e2);z>(e1);z--)
#define inint(e) scanf("%d",&e)
#define inll(e) scanf("%lld",&e)
#define inpr(e1,e2) scanf("%d%d",&e1,&e2)
#define in3(e1,e2,e3) scanf("%d%d%d",&e1,&e2,&e3)
#define outint(e) printf("%d\n",e)
#define outint_(e) printf("%d%c",e," \n"[i==n])
#define outll(e) printf("%lld\n",e)
#define outll_(e) printf("%lld%c",e," \n"[i==n])
#define exc(e) if(e) continue
#define stop(e) if(e) break
#define ret(e) if(e) return
#define ll(e) ((LL)(e))
#define pb push_back
#define ft first
#define sc second
#define clean(e) while(!e.empty()) e.pop()
#define all(ev) ev.begin(),ev.end()
#define x0 x00
#define y1 y11
#define debug(x) cerr<<#x<<'='<<x<<'\n'
#define fout fflush(stdout)
invoid input(int &N_,int A_[],bool F_)
{
    if(F_) inint(N_);
    For(i,1,N_) inint(A_[i]);
}
template <typename Type>
inline Type md(Type w1,const Type w2)
{
    w1%=w2; if(w1<0) w1+=w2;
    return w1;
}
template <typename Type>
invoid add(Type &w1,const Type w2,const Type M_)
{ w1=md(w1+w2,M_); }
invoid mul(LL &w1,cLL w2,cLL M_)
{ w1=md(w1*w2,M_); }
inLL gcd(LL X_,LL Y_)
{
    LL R_=X_%Y_;
    while(R_)
    { X_=Y_; Y_=R_; R_=X_%Y_; }
    return Y_;
}
invoid ex_gcd(LL &X_,LL &Y_,LL A_,LL B_)
{
    if(!B_)
    {
        X_=1ll; Y_=0ll;
        return ;
    }
    ex_gcd(Y_,X_,B_,A_%B_);
    X_=md(X_,B_); Y_=(1ll-X_*A_)/B_;
}
inLL inv(LL A_,LL B_)
{
    LL X_=0ll,Y_=0ll;
    ex_gcd(X_,Y_,A_,B_);
    return X_;
}
inLL pw(LL X_,LL Y_,LL M_)
{
    LL S_=1ll;
    while(Y_)
    {
        if(Y_&1) mul(S_,X_,M_);
        Y_>>=1;
        mul(X_,X_,M_);
    }
    return S_;
}
template <typename Type>
invoid get_min(Type &w1,const Type w2)
{ if(w2<w1) w1=w2; }
template <typename Type>
invoid get_max(Type &w1,const Type w2)
{ if(w2>w1) w1=w2; }
//inLL A(cint N_,cint M_)
//{ return (N_>=M_?md(d1[N_]*d2[N_-M_],mod):0ll); }
//inLL C(cint N_,cint M_)
//{ return (N_>=M_?md(d1[N_]*md(d2[M_]*d2[N_-M_],mod),mod):0ll); }
//mt19937 gen(time(NULL));
//mt19937_64 gen(time(NULL));
//cLL base[]={166686661,188868881},mod[]={1686688681,1666868881};
//cLL mod[]={1e9+7,1e9+9,1e9+21,1e9+33};
cint N=2100;
int n;
vector <pii> edge;
vector <vector <int> > v;
int cnt=0,d[N];
bool vis[N][N];
inbool work(vector <int> &t,int x)
{
    if(t.empty()) return false;
    cnt++;
    printf("? %d ",(int)t.size()+1);
    for(auto i:t)
        printf("%d ",i);
    outint(x);
    fout;
    int a,b;
    inpr(a,b);
    if(!~a) return false;
    edge.pb({a,b});
    vis[a][b]=vis[b][a]=true;
    if(a==x) swap(a,b);
    t.erase(find(all(t),a));
    return true;
}
struct Node
{
    int x,k;
    inbool operator < (const Node &A) const
    {
        return (k==A.k?x<A.x:k<A.k);
    }
};
set <Node> st;
invoid init(int m)
{
    For(i,1,m) d[i]=0;
    for(auto [x,y]:edge)
        d[x]++,d[y]++;
    st.clear();
    For(i,1,m) st.insert({i,d[i]});
    v.clear();
    while(!st.empty())
    {
        int p=st.begin()->x;
        //debug(p);
        st.erase(st.begin());
        bool f=false;
        for(auto &S:v)
        {
            bool ok=true;
            for(auto i:S)
                if(vis[i][p])
                {
                    ok=false;
                    break;
                }
            if(ok)
            {
                S.pb(p);
                f=true;
                break;
            }
        }
        if(!f) v.pb({p});
    }
}
int main()
{
    srand(time(NULL));
    inint(n);
    For(x,1,n)
    {
        for(auto &S:v)
        {
            while(work(S,x)) ;
        }
        init(x);
    }
    printf("! %d\n",(int)edge.size());
    for(auto [x,y]:edge)
        printf("%d %d\n",x,y);
    fout;
    //debug(cnt);
    return 0;
}
/*

*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3784kb

input:

3
1 2
1 3
2 3

output:

? 2 1 2
? 2 1 3
? 2 2 3
! 3
1 2
1 3
2 3

result:

ok correct

Test #2:

score: 0
Accepted
time: 0ms
memory: 3904kb

input:

10
1 2
1 3
-1 -1
-1 -1
1 4
4 5
2 5
-1 -1
-1 -1
2 6
-1 -1
-1 -1
3 7
-1 -1
-1 -1
-1 -1
4 8
-1 -1
3 8
-1 -1
-1 -1
-1 -1
-1 -1
3 9
-1 -1
-1 -1
4 10
3 10
-1 -1

output:

? 2 1 2
? 2 1 3
? 2 2 3
? 3 2 3 4
? 2 1 4
? 4 2 3 4 5
? 3 2 3 5
? 2 3 5
? 2 1 5
? 4 3 2 4 6
? 3 3 4 6
? 3 5 1 6
? 4 3 6 4 7
? 3 6 4 7
? 3 5 1 7
? 2 2 7
? 4 6 7 4 8
? 3 6 7 8
? 3 3 5 8
? 2 5 8
? 2 1 8
? 2 2 8
? 6 6 7 5 8 1 9
? 4 2 3 4 9
? 3 2 4 9
? 7 6 7 9 5 8 1 10
? 4 2 4 3 10
? 3 2 3 10
? 2 2 10
! ...

result:

ok correct

Test #3:

score: 0
Accepted
time: 1ms
memory: 3784kb

input:

5
2 1
3 1
3 2
4 1
4 2
-1 -1
-1 -1
5 1
5 2

output:

? 2 1 2
? 2 1 3
? 2 2 3
? 2 1 4
? 2 2 4
? 2 3 4
? 3 3 4 5
? 2 1 5
? 2 2 5
! 7
2 1
3 1
3 2
4 1
4 2
5 1
5 2

result:

ok correct

Test #4:

score: 0
Accepted
time: 1ms
memory: 3896kb

input:

3
2 1
1 3
-1 -1

output:

? 2 1 2
? 2 1 3
? 2 2 3
! 2
2 1
1 3

result:

ok correct

Test #5:

score: 0
Accepted
time: 0ms
memory: 3844kb

input:

6
1 2
3 1
3 2
-1 -1
4 2
3 4
4 5
-1 -1
2 5
3 5
-1 -1
-1 -1
-1 -1
3 6

output:

? 2 1 2
? 2 1 3
? 2 2 3
? 2 1 4
? 2 2 4
? 2 3 4
? 3 1 4 5
? 2 1 5
? 2 2 5
? 2 3 5
? 3 1 4 6
? 2 5 6
? 2 2 6
? 2 3 6
! 9
1 2
3 1
3 2
4 2
3 4
4 5
2 5
3 5
3 6

result:

ok correct

Test #6:

score: 0
Accepted
time: 6ms
memory: 3840kb

input:

27
-1 -1
3 1
3 2
-1 -1
-1 -1
1 5
2 5
-1 -1
3 5
6 1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
6 8
-1 -1
1 8
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
1 9
-1 -1
10 8
-1 -1
-1 -1
-1 -1
6 11
4 11
-1 -1
-1 -1
5 11
1 11
-1 -1
12 11
-1 -1
5 12
-1 -1
10 13
6 13
-1 -1
8 13
-1 -1
5 13
-1 -1
6 14
14 12
-1 -1
14 8
-1 -1
14...

output:

? 2 1 2
? 3 1 2 3
? 2 2 3
? 3 1 2 4
? 2 3 4
? 4 4 1 2 5
? 3 4 2 5
? 2 4 5
? 2 3 5
? 4 4 1 2 6
? 3 4 2 6
? 2 3 6
? 2 5 6
? 4 4 6 2 7
? 2 1 7
? 2 3 7
? 2 5 7
? 5 4 7 6 2 8
? 4 4 7 2 8
? 2 1 8
? 2 3 8
? 2 5 8
? 5 4 7 2 6 9
? 3 8 3 9
? 2 5 9
? 2 1 9
? 6 4 7 9 2 6 10
? 3 8 3 10
? 2 3 10
? 2 5 10
? 2 1 10...

result:

ok correct

Test #7:

score: 0
Accepted
time: 0ms
memory: 3824kb

input:

47
-1 -1
-1 -1
-1 -1
5 4
5 3
-1 -1
-1 -1
-1 -1
7 6
-1 -1
7 5
-1 -1
-1 -1
5 8
9 4
-1 -1
-1 -1
-1 -1
-1 -1
10 7
-1 -1
-1 -1
11 1
-1 -1
7 11
-1 -1
-1 -1
12 3
2 12
-1 -1
11 12
-1 -1
5 12
7 12
-1 -1
13 11
-1 -1
13 5
13 7
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
13 15
-1 -1
4 15
-1 -1
-1 -1
-1 -1
-1 -1
16 1
-1...

output:

? 2 1 2
? 3 1 2 3
? 4 1 2 3 4
? 5 1 2 3 4 5
? 4 1 2 3 5
? 3 1 2 5
? 5 1 2 3 4 6
? 2 5 6
? 6 1 2 6 3 4 7
? 5 1 2 3 4 7
? 2 5 7
? 6 1 2 3 4 6 8
? 2 7 8
? 2 5 8
? 7 1 2 3 4 6 8 9
? 6 1 2 3 6 8 9
? 2 7 9
? 2 5 9
? 7 1 2 3 6 8 9 10
? 3 4 7 10
? 2 4 10
? 2 5 10
? 8 1 2 3 6 8 9 10 11
? 7 2 3 6 8 9 10 11
? ...

result:

ok correct

Test #8:

score: 0
Accepted
time: 0ms
memory: 3936kb

input:

38
-1 -1
-1 -1
4 1
-1 -1
1 5
3 5
-1 -1
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2 3 6 8
? 4 1 3 6 8
? 3 4 7 8
? 2 7 8
? 2 5 8
? 5 1 3 6 2 9
? 4 1 3 6 9
? 3 7 4 9
? 2 7 9
? 2 8 9
? 2 5 9
? 5 1 3 6 2 10
? 4 1 6 2 10
? 3 7 9 10
? 2 4 1...

result:

ok correct

Test #10:

score: 0
Accepted
time: 3ms
memory: 3784kb

input:

6
-1 -1
2 3
-1 -1
-1 -1
-1 -1
2 5
-1 -1
-1 -1
5 6
-1 -1
-1 -1

output:

? 2 1 2
? 3 1 2 3
? 2 1 3
? 3 1 2 4
? 2 3 4
? 4 1 4 2 5
? 3 1 4 5
? 2 3 5
? 5 1 4 3 5 6
? 4 1 4 3 6
? 2 2 6
! 3
2 3
2 5
5 6

result:

ok correct

Test #11:

score: 0
Accepted
time: 2ms
memory: 3776kb

input:

3
2 1
3 1
2 3

output:

? 2 1 2
? 2 1 3
? 2 2 3
! 3
2 1
3 1
2 3

result:

ok correct

Test #12:

score: 0
Accepted
time: 1ms
memory: 3780kb

input:

3
2 1
3 1
-1 -1

output:

? 2 1 2
? 2 1 3
? 2 2 3
! 2
2 1
3 1

result:

ok correct

Test #13:

score: 0
Accepted
time: 1ms
memory: 3780kb

input:

5
2 1
3 1
2 3
-1 -1
-1 -1
-1 -1
5 1
-1 -1
2 5
-1 -1

output:

? 2 1 2
? 2 1 3
? 2 2 3
? 2 1 4
? 2 2 4
? 2 3 4
? 3 4 1 5
? 2 4 5
? 2 2 5
? 2 3 5
! 5
2 1
3 1
2 3
5 1
2 5

result:

ok correct

Test #14:

score: 0
Accepted
time: 2ms
memory: 3772kb

input:

3
2 1
-1 -1
-1 -1

output:

? 2 1 2
? 2 1 3
? 2 2 3
! 1
2 1

result:

ok correct

Test #15:

score: 0
Accepted
time: 1ms
memory: 3780kb

input:

5
-1 -1
-1 -1
4 3
-1 -1
2 5
3 5
-1 -1
-1 -1

output:

? 2 1 2
? 3 1 2 3
? 4 1 2 3 4
? 3 1 2 4
? 4 1 2 3 5
? 3 1 3 5
? 2 1 5
? 2 4 5
! 3
4 3
2 5
3 5

result:

ok correct

Test #16:

score: 0
Accepted
time: 5ms
memory: 3968kb

input:

93
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
10 9
-1 -1
7 11
-1 -1
-1 -1
2 12
-1 -1
-1 -1
5 13
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
15 12
-1 -1
6 16
8 16
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
19 18
-1 -1
11 19
-1 -1
-1 -1
20 16
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
8 23
1 23
-1 -1
-1 -1
-1 -1...

output:

? 2 1 2
? 3 1 2 3
? 4 1 2 3 4
? 5 1 2 3 4 5
? 6 1 2 3 4 5 6
? 7 1 2 3 4 5 6 7
? 8 1 2 3 4 5 6 7 8
? 9 1 2 3 4 5 6 7 8 9
? 10 1 2 3 4 5 6 7 8 9 10
? 9 1 2 3 4 5 6 7 8 10
? 10 1 2 3 4 5 6 7 8 9 11
? 9 1 2 3 4 5 6 8 9 11
? 2 10 11
? 10 1 2 3 4 5 6 8 7 9 12
? 9 1 3 4 5 6 8 7 9 12
? 3 10 11 12
? 10 1 3 4...

result:

ok correct

Test #17:

score: 0
Accepted
time: 1ms
memory: 5992kb

input:

111
-1 -1
-1 -1
-1 -1
-1 -1
2 6
-1 -1
7 4
-1 -1
-1 -1
3 8
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
2 11
4 11
-1 -1
-1 -1
6 12
7 12
12 11
-1 -1
12 4
-1 -1
7 13
13 10
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
17 10
-1 -1
-1 -1
-1 -1
-1 -1
18 5
4 18
-1 -...

output:

? 2 1 2
? 3 1 2 3
? 4 1 2 3 4
? 5 1 2 3 4 5
? 6 1 2 3 4 5 6
? 5 1 3 4 5 6
? 6 1 3 4 5 2 7
? 5 1 3 5 2 7
? 2 6 7
? 6 1 3 5 2 4 8
? 5 1 5 2 4 8
? 3 6 7 8
? 6 1 5 2 3 4 9
? 4 6 7 8 9
? 7 1 5 9 2 3 4 10
? 4 6 7 8 10
? 8 1 5 9 10 2 3 4 11
? 7 1 5 9 10 3 4 11
? 6 1 5 9 10 3 11
? 4 6 7 8 11
? 9 1 5 9 10 3 ...

result:

ok correct

Test #18:

score: 0
Accepted
time: 18ms
memory: 4064kb

input:

132
-1 -1
3 1
-1 -1
-1 -1
-1 -1
5 1
-1 -1
-1 -1
6 3
-1 -1
-1 -1
7 2
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
10 8
5 10
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
12 8
-1 -1
-1 -1
-1 -1
9 13
-1 -1
-1 -1
2 14
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
17 15
-1 -1
-1 -1
-1 -1
-1 -1
19 10
19 6
-1 -1
17 1...

output:

? 2 1 2
? 3 1 2 3
? 2 2 3
? 3 2 1 4
? 2 3 4
? 4 2 4 1 5
? 3 2 4 5
? 2 3 5
? 5 2 4 3 5 6
? 4 2 4 5 6
? 2 1 6
? 5 2 4 5 6 7
? 4 4 5 6 7
? 2 1 7
? 2 3 7
? 5 4 2 5 6 8
? 3 7 1 8
? 2 3 8
? 6 4 8 2 5 6 9
? 3 7 1 9
? 2 3 9
? 7 4 8 9 2 5 6 10
? 6 4 9 2 5 6 10
? 5 4 9 2 6 10
? 3 7 1 10
? 2 3 10
? 7 4 9 2 6 8...

result:

ok correct

Test #19:

score: 0
Accepted
time: 4ms
memory: 4048kb

input:

94
-1 -1
3 2
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
2 7
-1 -1
-1 -1
-1 -1
-1 -1
7 9
-1 -1
2 9
-1 -1
-1 -1
-1 -1
11 6
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
6 13
-1 -1
11 13
-1 -1
-1 -1
14 10
-1 -1
14 11
-1 -1
-1 -1
-1 -1
-1 -1
15 11
-1 -1
15 16
16 7
-1 -1
-1 -1
-1 -1
17 8
17 10
-1 -1
-1 -1
17 11
-1 ...

output:

? 2 1 2
? 3 1 2 3
? 2 1 3
? 3 1 2 4
? 2 3 4
? 4 1 4 2 5
? 2 3 5
? 5 1 4 5 2 6
? 2 3 6
? 6 1 4 5 6 2 7
? 5 1 4 5 6 7
? 2 3 7
? 7 1 4 5 6 3 7 8
? 2 2 8
? 8 1 4 5 6 8 3 7 9
? 7 1 4 5 6 8 3 9
? 2 2 9
? 8 1 4 5 6 8 3 7 10
? 2 9 10
? 2 2 10
? 9 1 4 5 6 8 10 3 7 11
? 8 1 4 5 8 10 3 7 11
? 2 9 11
? 2 2 11
?...

result:

ok correct

Test #20:

score: 0
Accepted
time: 4ms
memory: 3932kb

input:

73
-1 -1
1 3
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
5 7
6 7
-1 -1
-1 -1
-1 -1
3 8
-1 -1
1 9
9 8
-1 -1
-1 -1
4 10
1 10
-1 -1
3 10
9 10
-1 -1
4 11
-1 -1
-1 -1
-1 -1
-1 -1
12 9
12 3
-1 -1
12 10
13 6
13 11
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
15 8
-1 -1
-1 -1
-1 -1
1 16
16 14
-1 -1
10 16
-1 -1
3 16
-1...

output:

? 2 1 2
? 3 1 2 3
? 2 2 3
? 3 2 1 4
? 2 3 4
? 4 2 4 1 5
? 2 3 5
? 5 2 4 5 1 6
? 2 3 6
? 6 2 4 5 6 1 7
? 5 2 4 6 1 7
? 4 2 4 1 7
? 2 3 7
? 6 2 4 1 5 6 8
? 3 3 7 8
? 2 7 8
? 7 2 4 1 5 6 8 9
? 6 2 4 5 6 8 9
? 5 2 4 5 6 9
? 3 3 7 9
? 7 2 4 5 6 1 8 10
? 6 2 5 6 1 8 10
? 5 2 5 6 8 10
? 4 3 7 9 10
? 3 7 9 ...

result:

ok correct

Test #21:

score: 0
Accepted
time: 12ms
memory: 3944kb

input:

77
-1 -1
3 2
-1 -1
2 4
-1 -1
-1 -1
-1 -1
-1 -1
3 6
-1 -1
-1 -1
-1 -1
-1 -1
3 7
-1 -1
-1 -1
3 8
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
1 11
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
8 13
-1 -1
-1 -1
-1 -1
14 7
-1 -1
14 8
2 14
-1 -1
-1 -1
-1 -1
15 8
2 15
-1 -1
3 15
-1 -1
16 15
16 1
-1 -1
-1 -1
2 16
16 8
7 17
-...

output:

? 2 1 2
? 3 1 2 3
? 2 1 3
? 3 1 2 4
? 2 1 4
? 2 3 4
? 4 1 3 4 5
? 2 2 5
? 5 1 5 3 4 6
? 4 1 5 4 6
? 2 2 6
? 5 1 5 4 6 7
? 2 2 7
? 2 3 7
? 6 1 5 4 6 7 8
? 2 2 8
? 2 3 8
? 7 1 5 4 6 7 8 9
? 2 2 9
? 2 3 9
? 8 1 5 9 4 6 7 8 10
? 2 2 10
? 2 3 10
? 9 1 5 9 10 4 6 7 8 11
? 8 5 9 10 4 6 7 8 11
? 2 2 11
? 2 ...

result:

ok correct

Test #22:

score: 0
Accepted
time: 11ms
memory: 4036kb

input:

81
-1 -1
2 3
-1 -1
2 4
-1 -1
-1 -1
4 5
1 5
-1 -1
-1 -1
4 6
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
1 8
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
10 3
10 6
-1 -1
2 10
-1 -1
10 4
11 3
-1 -1
-1 -1
4 11
-1 -1
6 12
8 12
2 12
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
10 13
-1 -1
-1 -1
1 14
-1 -1
-1 -1
-1 -1
10 14
13 15
-1 -1
-1 -1
-...

output:

? 2 1 2
? 3 1 2 3
? 2 1 3
? 3 1 2 4
? 2 1 4
? 2 3 4
? 4 1 3 4 5
? 3 1 3 5
? 2 3 5
? 2 2 5
? 4 1 3 4 6
? 3 1 3 6
? 3 2 5 6
? 4 1 3 6 7
? 3 2 5 7
? 2 4 7
? 5 7 1 3 6 8
? 4 7 3 6 8
? 3 2 5 8
? 2 4 8
? 6 7 3 6 8 5 9
? 3 1 2 9
? 2 4 9
? 7 7 9 3 6 8 5 10
? 6 7 9 6 8 5 10
? 5 7 9 8 5 10
? 3 1 2 10
? 2 1 10...

result:

ok correct

Test #23:

score: 0
Accepted
time: 1ms
memory: 3996kb

input:

93
-1 -1
-1 -1
4 1
2 4
-1 -1
-1 -1
-1 -1
-1 -1
4 6
2 7
-1 -1
-1 -1
1 8
3 8
-1 -1
-1 -1
-1 -1
9 1
-1 -1
9 8
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
13 7
-1 -1
-1 -1
-1 -1
9 14
-1 -1
1 14
-1 -1
4 14
-1 -1
-1 -1
14 15
-1 -1
-1 -1
-1 -1
13 16
-1 -1
-1 -1
-1 -1
-1 -1
17 5
17 3
1...

output:

? 2 1 2
? 3 1 2 3
? 4 1 2 3 4
? 3 2 3 4
? 2 3 4
? 4 3 1 2 5
? 2 4 5
? 5 3 5 1 2 6
? 2 4 6
? 6 3 5 1 2 6 7
? 5 3 5 1 6 7
? 2 4 7
? 6 3 5 1 6 7 8
? 5 3 5 6 7 8
? 4 5 6 7 8
? 2 2 8
? 2 4 8
? 6 5 3 6 7 1 9
? 5 5 3 6 7 9
? 3 2 8 9
? 2 2 9
? 2 4 9
? 6 5 3 6 7 9 10
? 3 2 1 10
? 3 4 8 10
? 7 5 10 3 6 7 9 11...

result:

ok correct

Test #24:

score: 0
Accepted
time: 6ms
memory: 3972kb

input:

37
-1 -1
3 1
-1 -1
-1 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 9
? 10 1 2 3 4 5 6 7 8 9 10
? 11 1 2 3 4 5 6 7 8 9 10 11
? 12 1 2 3 4 5 6 7 8 9 10 11 12
? 13 1 2 3 4 5 6 7 8 9 10 11 12 13
? 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14
? 15 1 2 3 4 5 6 7 8...

result:

ok correct

Test #26:

score: 0
Accepted
time: 43ms
memory: 5076kb

input:

561
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
26 22
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -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:

? 2 1 2
? 3 1 2 3
? 4 1 2 3 4
? 5 1 2 3 4 5
? 6 1 2 3 4 5 6
? 7 1 2 3 4 5 6 7
? 8 1 2 3 4 5 6 7 8
? 9 1 2 3 4 5 6 7 8 9
? 10 1 2 3 4 5 6 7 8 9 10
? 11 1 2 3 4 5 6 7 8 9 10 11
? 12 1 2 3 4 5 6 7 8 9 10 11 12
? 13 1 2 3 4 5 6 7 8 9 10 11 12 13
? 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14
? 15 1 2 3 4 5 6 7 8...

result:

ok correct

Test #27:

score: 0
Accepted
time: 72ms
memory: 5240kb

input:

679
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
39 40
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1...

output:

? 2 1 2
? 3 1 2 3
? 4 1 2 3 4
? 5 1 2 3 4 5
? 6 1 2 3 4 5 6
? 7 1 2 3 4 5 6 7
? 8 1 2 3 4 5 6 7 8
? 9 1 2 3 4 5 6 7 8 9
? 10 1 2 3 4 5 6 7 8 9 10
? 11 1 2 3 4 5 6 7 8 9 10 11
? 12 1 2 3 4 5 6 7 8 9 10 11 12
? 13 1 2 3 4 5 6 7 8 9 10 11 12 13
? 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14
? 15 1 2 3 4 5 6 7 8...

result:

ok correct

Test #28:

score: -100
Runtime Error

input:

1000
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
17 27
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-1 -1
-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:

? 2 1 2
? 3 1 2 3
? 4 1 2 3 4
? 5 1 2 3 4 5
? 6 1 2 3 4 5 6
? 7 1 2 3 4 5 6 7
? 8 1 2 3 4 5 6 7 8
? 9 1 2 3 4 5 6 7 8 9
? 10 1 2 3 4 5 6 7 8 9 10
? 11 1 2 3 4 5 6 7 8 9 10 11
? 12 1 2 3 4 5 6 7 8 9 10 11 12
? 13 1 2 3 4 5 6 7 8 9 10 11 12 13
? 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14
? 15 1 2 3 4 5 6 7 8...

result: