QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#658456 | #6303. Inversion | Fluoresce# | WA | 1ms | 3564kb | C++20 | 1.5kb | 2024-10-19 16:50:57 | 2024-10-19 16:50:57 |
Judging History
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