Submission #18200195


Source Code Expand

Copy
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<bitset>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
#include<complex>
#include<cassert>
#include<random>
using namespace std;
#include<atcoder/all>
using namespace atcoder;


#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MAX = 4000001;
const long double eps = 1E-14;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

ll gcd(ll a, ll b) {
	if (b == 0) { return a; }
	if (a < b) { return gcd(b, a); }
	return gcd(b, a % b);
}

ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};

using mint = modint;

typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;

typedef vector<mint> vmint;
typedef vector<vector<mint>> vvmint;
typedef vector<vector<vector<mint>>> vvvmint;

vmint f, finv, inv;

void cominit(ll N) {
	ll MOD = modint::mod();//デフォルトが998244353に注意

	f.assign(N + 1, 1);
	finv.assign(N + 1, 1);
	inv.assign(N + 1, 1);
	inv[1] = 1;

	repn(i, N) {
		f[i] = f[i - 1] * i;
		if (i > 1)inv[i] = -inv[MOD % i] * (MOD / i);
		finv[i] = finv[i - 1] * inv[i];
	}
}

mint com(ll a, ll b) {
	if (a < 0 || b < 0 || a < b) { return 0; }
	return f[a] * finv[b] * finv[a - b];
}


/////////////////////////////////////
ll debug = 0;

ll N;
vll w;

ll query(vll s) {
	cout << '?';
	rep(i,N) {
		cout << " " << s[i];
	}
	cout << endl;
	ll ans = 0;

	if (debug) { rep(i,N)ans += s[i] * w[i]; }
	else { cin >> ans; }
	return ans;
}

int main() {
	cin >> N;
	
	if (debug) {
		w.resize(N);
		rep(i, N) { cin >> w[i]; }
	}

	vll a(N);

	for (ll i = 0; i < N; i += 5) {
		vll s(N);
		
		ll x = 1;
		rep(k, min(5, N - i)) {
			s[i + k] = x;
			x *= 10;
		}
		
		ll ret = query(s);

		x = 8;
		rep(k, min(5, N - i)) {
			ret -= x;
			x *= 10;
		}

		rep(k, min(5, N - i)) {
			a[i + k] = ret % 2;
			ret /= 10;
		}
	}

	cout << '!';
	rep(i, N)cout << " " << a[i];
	cout << endl;
	
}

Submission Info

Submission Time
Task E - Coin Authentication
User dokin
Language C++ (GCC 9.2.1)
Score 400
Code Size 2360 Byte
Status AC
Exec Time 13 ms
Memory 3676 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 1
AC × 30
Set Name Test Cases
Sample sample_01.txt
All sample_01.txt, subtask_1_1.txt, subtask_1_10.txt, subtask_1_11.txt, subtask_1_12.txt, subtask_1_13.txt, subtask_1_14.txt, subtask_1_15.txt, subtask_1_16.txt, subtask_1_17.txt, subtask_1_18.txt, subtask_1_19.txt, subtask_1_2.txt, subtask_1_20.txt, subtask_1_21.txt, subtask_1_22.txt, subtask_1_23.txt, subtask_1_24.txt, subtask_1_25.txt, subtask_1_26.txt, subtask_1_27.txt, subtask_1_28.txt, subtask_1_29.txt, subtask_1_3.txt, subtask_1_4.txt, subtask_1_5.txt, subtask_1_6.txt, subtask_1_7.txt, subtask_1_8.txt, subtask_1_9.txt
Case Name Status Exec Time Memory
sample_01.txt AC 13 ms 3528 KB
subtask_1_1.txt AC 7 ms 3632 KB
subtask_1_10.txt AC 6 ms 3644 KB
subtask_1_11.txt AC 9 ms 3556 KB
subtask_1_12.txt AC 6 ms 3656 KB
subtask_1_13.txt AC 7 ms 3632 KB
subtask_1_14.txt AC 6 ms 3588 KB
subtask_1_15.txt AC 8 ms 3672 KB
subtask_1_16.txt AC 7 ms 3644 KB
subtask_1_17.txt AC 6 ms 3488 KB
subtask_1_18.txt AC 6 ms 3648 KB
subtask_1_19.txt AC 7 ms 3584 KB
subtask_1_2.txt AC 9 ms 3588 KB
subtask_1_20.txt AC 6 ms 3556 KB
subtask_1_21.txt AC 9 ms 3676 KB
subtask_1_22.txt AC 7 ms 3648 KB
subtask_1_23.txt AC 10 ms 3536 KB
subtask_1_24.txt AC 10 ms 3648 KB
subtask_1_25.txt AC 8 ms 3604 KB
subtask_1_26.txt AC 5 ms 3636 KB
subtask_1_27.txt AC 7 ms 3632 KB
subtask_1_28.txt AC 8 ms 3632 KB
subtask_1_29.txt AC 6 ms 3544 KB
subtask_1_3.txt AC 10 ms 3532 KB
subtask_1_4.txt AC 9 ms 3548 KB
subtask_1_5.txt AC 9 ms 3544 KB
subtask_1_6.txt AC 9 ms 3644 KB
subtask_1_7.txt AC 6 ms 3524 KB
subtask_1_8.txt AC 6 ms 3560 KB
subtask_1_9.txt AC 7 ms 3584 KB