ソースコード 拡げる

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]; }
}

ll M = 50;
vll a(M);

for (ll i = 0; i < M; i += 5) {
vll s(M);
s[i] = 1;
s[i + 1] = 10;
s[i + 2] = 100;
s[i + 3] = 1000;
s[i + 4] = 10000;

ll ret = query(s);

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

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

}
```

#### 提出情報

提出日時 2020-11-18 14:29:24+0900 E - Coin Authentication dokin C++ (GCC 9.2.1) 0 2316 Byte WA 12 ms 3672 KB

#### ジャッジ結果

セット名 Sample All

 AC × 1
 AC × 18 WA × 12
セット名 テストケース
Sample sample_01.txt
ケース名 結果 実行時間 メモリ
sample_01.txt AC 12 ms 3652 KB
subtask_1_1.txt WA 6 ms 3596 KB
subtask_1_10.txt WA 8 ms 3668 KB
subtask_1_11.txt AC 6 ms 3596 KB
subtask_1_12.txt AC 9 ms 3636 KB
subtask_1_13.txt WA 6 ms 3592 KB
subtask_1_14.txt WA 3 ms 3600 KB
subtask_1_15.txt WA 7 ms 3644 KB
subtask_1_16.txt WA 6 ms 3484 KB
subtask_1_17.txt AC 9 ms 3596 KB
subtask_1_18.txt AC 7 ms 3508 KB
subtask_1_19.txt AC 7 ms 3568 KB
subtask_1_2.txt AC 6 ms 3640 KB
subtask_1_20.txt AC 9 ms 3612 KB
subtask_1_21.txt AC 6 ms 3556 KB
subtask_1_22.txt AC 4 ms 3592 KB
subtask_1_23.txt AC 7 ms 3544 KB
subtask_1_24.txt AC 7 ms 3568 KB
subtask_1_25.txt AC 6 ms 3632 KB
subtask_1_26.txt WA 6 ms 3564 KB
subtask_1_27.txt AC 6 ms 3612 KB
subtask_1_28.txt AC 6 ms 3668 KB
subtask_1_29.txt AC 6 ms 3608 KB
subtask_1_3.txt WA 6 ms 3672 KB
subtask_1_4.txt WA 6 ms 3588 KB
subtask_1_5.txt WA 6 ms 3596 KB
subtask_1_6.txt AC 5 ms 3588 KB
subtask_1_7.txt WA 4 ms 3668 KB
subtask_1_8.txt WA 7 ms 3612 KB
subtask_1_9.txt AC 6 ms 3508 KB