QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#567634 | #9313. Make Max | xiangji | WA | 0ms | 3604kb | C++14 | 1.4kb | 2024-09-16 13:12:27 | 2024-09-16 13:12:29 |
Judging History
answer
// #pragma GCC optimize(2)
// #pragma GCC optimize(3,"Ofast","inline")
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "D:/OneDrive/study/cpp/.vscode/debug.h"
#else
#define debug(...) 42;
#endif
#define int long long
#define endl "\n"
#define ull unsigned long long
#define ll __int128_t
mt19937 rd(chrono::system_clock::now().time_since_epoch().count());
const int mod = 998244353;
const int inf = 0x3f3f3f3f3f3f3f3f;
const int MAXN = 2e5 + 10;
const double eps = 1e-6;
const int hash_p1 = 1610612741;
const int hash_p2 = 805306457;
const int hash_p3 = 402653189;
const int base_1 = 131;
const int base_2 = 13331;
int n, t;
int vis[1010];
//#pragma comment(linker, “/ STACK : 1024000000, 1024000000 ”)
void solve()
{
cin >> n;
for (int i = 1; i < n; i++)
{
if (!vis[i])
{
t = i + 1;
while (t != min(t, i))
{
cout << "? " << i << ' ' << t << endl;
cin >> t;
}
vis[t] = i;
}
}
cout << "! ";
for (int i = 1; i < n; i++)
{
if (vis[i])
{
cout << vis[i] << ' ' << i << ' ';
}
}
}
signed main()
{
// ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int _ = 1;
cin >> _;
while (_--)
solve();
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3604kb
input:
4 2 1 2 2 2 2 7 1 1 1 2 2 2 2 3 1 2 3
output:
? 1 2 ! 1 1 ! 1 1 ! 1 1 ! 1 1
result:
wrong output format Expected integer, but "?" found