QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#338910#4218. Hidden GraphYMH_fourteenWA 1ms3776kbC++141.1kb2024-02-26 14:40:202024-02-26 14:40:21

Judging History

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

  • [2024-02-26 14:40:21]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3776kb
  • [2024-02-26 14:40:20]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#include "templates/debug.h"
#else
#define dbg(...) (void)0
#define msg(...) (void)0
#endif
#define ll long long
#define PB emplace_back
#define PPB pop_back
#define MP make_pair
#define ALL(Name) Name.begin(),Name.end()
#define PII pair<int,int>
#define VI vector<int>
#define fi first
#define se second



int main()
{
	ios::sync_with_stdio(false),cin.tie(nullptr);
//	int _;cin>>_;while(_--)

	int n;
	cin>>n;
	vector<VI>idp;
	vector<PII>g;
	for(int i=1;i<=n;i++)
	{
		int ins=idp.size();
		for(int j=0;j<idp.size();j++)
		{
			set<int>st(ALL(idp[j]));
			while(!st.empty())
			{
				cout<<"? ";
				for(int k:st)cout<<k<<" ";
				cout<<i<<endl;
				int x,y;
				cin>>x>>y;
				if(~x)
				{
					g.PB(x,y);
					if(x>y)swap(x,y);
					st.erase(x);
				}
				else break;
			}
			if(st.size()==idp[j].size())ins=j;
		}
		if(idp.size()==ins)idp.PB(VI());
		idp[ins].PB(i);
	}
	cout<<"! "<<g.size()<<endl;
	for(auto i:g)cout<<i.fi<<" "<<i.se<<endl;

	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3776kb

input:

3
-1 -1
-1 -1

output:

? 1 2
? 1 2 3
! 0

result:

wrong answer unknown token 3