#include <iostream>
#include <algorithm>
#include <vector>
#define int long long
using namespace std;
const int NMAX=1e6+505;
int cnt,ine[2][NMAX+5],lv[NMAX+5],ar[4*NMAX+505],n,t[2][NMAX+5],cen[2],invine[2][NMAX+5],k,q,T,id[NMAX+5],dp[NMAX+5],imp[NMAX+5],invid[NMAX+5],rr[2][NMAX+5];
vector <int> v[2][NMAX+5];
pair<pair<int,int>,pair<int,int>> ras[NMAX+5];
void read(int ind)
{
for (int i=1;i<=n;++i)
{
cin>>t[ind][i];
//if (t[ind][i]==-1) cen[ind]=i;
//else {v[ind][t[ind][i]].push_back(i);}
}
/**cnt=0;
dfs(cen[ind],0,ind);
for (int i=1;i<=n;++i)
{
invine[ind][ine[ind][i]]=i;
}**/
}
signed main()
{
cin>>n>>k>>q>>T;
read(0);
read(1);
for (int i=1;i<=k;++i)
{
//imp[i]=invine[0][i];
imp[i]=i;
cout<<imp[i]<<" ";
}
cout<<'\n';
cout.flush();
for (int i=1;i<=k;++i)
{
id[i]=imp[i];
}
//sort(id+1,id+k+1,cmp);
/** for (int i=1;i<=k;++i)
{
invid[id[i]]=i;
}**/
for (int i=1;i<k;++i)
{
cout<<"? "<<id[i]<<" "<<id[i+1]<<'\n';
}
cout<<"!"<<'\n';
cout.flush();
for (int i=1;i<k;++i)
{
cin>>ras[i].first.first>>ras[i].first.second>>ras[i].second.first>>ras[i].second.second;
}
// solve0();
// solve1();
// makermq();
for (int i=1;i<=T;++i)
{
int x,y;
cin>>x>>y;
// x=invid[x];
// y=invid[y];
// if (x>y) swap(x,y);
// rr[1][i]=ras[x].second.first+ras[y-1].second.second+((x>=y-1) ? 0 : query(1,k,1,x+1,y-1));
// rr[0][i]=dp[x]+dp[y]-2*dp[lca(x,y)];
}
for (int i=1;i<=T;++i)
cout<<0<<" "<<0<<'\n';
cout.flush();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
275 ms |
72380 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
301 ms |
74672 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
199 ms |
70168 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
444 ms |
74276 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
547 ms |
78576 KB |
Execution killed with signal 13 |
2 |
Halted |
0 ms |
0 KB |
- |