QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#658456#6303. InversionFluoresce#WA 1ms3564kbC++201.5kb2024-10-19 16:50:572024-10-19 16:50:57

Judging History

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

  • [2024-10-19 16:50:57]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3564kb
  • [2024-10-19 16:50:57]
  • 提交

answer

#include<bits/stdc++.h>
#include<unordered_map>
#include<unordered_set>
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
#define debug(a) cout<<a<<'\n'
#define Pll pair<ll,ll>
#define PII pair<int,int>
#define ft first
#define sd second
#define vec vector
#define pushk push_back
#define ump unordered_map
#define pl p<<1
#define pr p<<1|1
using namespace std;
const int N = 15 + 10, M = 1e4 + 10, mod = 1e9 + 7;
const ll inf = 1e18;
const ld eps = 1e-13;
int mov[4][2] = { {0,1},{1,0},{-1,0},{0,-1} }, dx, dy, _ = 1, __ = 1;
void bout(bool f) {
	if (f)cout << "Yes\n";
	else cout << "No\n";
}
ll n, m, k;
int p[N];
bool st[N];
void qy(int l,int r){
	cout<<"? "<<l<<' '<<r<<endl;
}

void ini(){
	
}
void solve() {
	cin>>n;
	int o1,o2,x,cnt=0;
	for(int i=1;i<n;++i){
		qy(i,n);
		cin>>o1;
		qy(i+1,n);
		cin>>o2;
		cnt=o1-o2+1;
		for(int j=1;j<=n;++j){
			if(!st[j]){
				--cnt;
				if(!cnt){
					x=j;
					st[j]=1;
					p[i]=j;
					break;
				}
			}
		}
	}
	for(int i=1;i<=n;++i){
		if(!st[i]){
			p[n]=i;
			break;
		}
	}
	cout<<"! ";
	for(int i=1;i<=n;++i)cout<<p[i]<<' ';
	cout<<endl;
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	streambuf* cinbackup = cin.rdbuf(), * coutbackup = cout.rdbuf();
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	cin.rdbuf(fin.rdbuf());
	cout.rdbuf(fout.rdbuf());
#endif
	//cin >> _;
	__ = _;
	ini();
	while (_--) {
		solve();
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
0
1
1
0

output:

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

result:

wrong output format Unexpected end of file - token expected