QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#279271#1834. Eulerian?rageOfThunder#WA 0ms3448kbC++141.5kb2023-12-08 14:57:322023-12-08 14:57:32

Judging History

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

  • [2023-12-08 14:57:32]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3448kb
  • [2023-12-08 14:57:32]
  • 提交

answer

// MagicDark
#include <bits/stdc++.h>
#define debug cerr << "[" << __LINE__ << "] "
#define SZ(x) (int) x.size() - 1
#define all(x) x.begin(), x.end()
#define ms(x, y) memset(x, y, sizeof x)
#define F(i, x, y) for (int i = (x); i <= (y); i++)
#define DF(i, x, y) for (int i = (x); i >= (y); i--)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
template <typename T> inline void chkmax(T& x, T y) {x = max(x, y);}
template <typename T> inline void chkmin(T& x, T y) {x = min(x, y);}
template <typename T> inline void read(T &x) {
	x = 0; int f = 1; char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
	x *= f;
}
mt19937 mrand(chrono::steady_clock::now().time_since_epoch().count());
inline int rnd(int l, int r) {return mrand() % (r - l + 1) + l;}
const int N = 1e4 + 10;
bool vis[N];
signed main() {
	int n; read(n);
	cout << "? ";
	F(i, 1, n) cout << i << ' '; cout << endl;
	int tot;
	cin >> tot;
	F(i, 1, 29) {
		vector <int> t;
		int s1 = 0;
		F(i, 1, n) s1 += vis[i] = rnd(0, 1);
		cout << "? " << n - s1 << ' ';
		F(i, 1, n)
			if (!vis[i]) cout << i << ' ';
		cout << endl;
		int ans1; cin >> ans1;
		cout << "? " << s1 << ' ';
		F(i, 1, n)
			if (vis[i]) cout << i << ' ';
		cout << endl;
		int ans2; cin >> ans2;
		if ((tot - ans1 - ans2) & 1) {
			cout << "! NO" << endl;
			return 0;
		}
	}
	cout << "! YES" << endl;
	return 0;
}
/* why?
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3448kb

input:

3
0
-1

output:

? 1 2 3 
? 2 2 3 
? 1 1 

result:

wrong output format Unexpected end of file - token expected