QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#658441#6303. InversionFluoresce#Compile Error//C++201.5kb2024-10-19 16:49:372024-10-19 16:49:40

Judging History

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

  • [2024-10-19 16:49:40]
  • 评测
  • [2024-10-19 16:49:37]
  • 提交

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 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;
					break;
				}
			}
		}
		p[i]=j;
	}
	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

answer.code: In function ‘void solve()’:
answer.code:52:22: error: ‘j’ was not declared in this scope
   52 |                 p[i]=j;
      |                      ^
answer.code: In function ‘int main()’:
answer.code:78:9: error: ‘ini’ was not declared in this scope; did you mean ‘int’?
   78 |         ini();
      |         ^~~
      |         int