Submission #17407960


Source Code Expand

Copy
//#include<outputchecker.cpp>
#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
/*----------------------------------ここからマクロ----------------------------------*/
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define vecin(a) rep(i,a.size())cin >> a[i]
#define overload4(_1,_2,_3,_4,name,...) name
/*#define rep1(n) for(int i=0;i<(int)n;++i)
#define rep2(i,n) for(int i=0;i<(int)n;++i)
#define rep3(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define rep4(i,a,b,c) for(int i=(int)a;i<(int)b;i+=(int)c)*/
#define rep1(n) for(ll i=0;i<(ll)n;++i)
#define rep2(i,n) for(ll i=0;i<(ll)n;++i)
#define rep3(i,a,b) for(ll i=(ll)a;i<(ll)b;++i)
#define rep4(i,a,b,c) for(int i=(ll)a;i<(ll)b;i+=(ll)c)
#define rep(...) overload4(__VA_ARGS__,rep4,rep3,rep2,rep1)(__VA_ARGS__)
#ifdef _DEBUG
#define debug1(a) cerr << #a << ": " << a << "\n"
#define debug2(a,b) cerr << #a << ": " << a << ", " << #b << ": " << b << "\n"
#define debug3(a,b,c) cerr << #a << ": " << a << ", " << #b << ": " << b << ", " << #c << ": " << c << "\n"
#define debug4(a,b,c,d) cerr << #a << ": " << a << ", " << #b << ": " << b << ", " << #c << ": " << c << ", " << #d << ": " << d << "\n"
#define debug(...) overload4(__VA_ARGS__,debug4,debug3,debug2,debug1)(__VA_ARGS__)
#define vecout(a) cerr << #a << ": [";rep(i,a.size()){cerr << a[i];cerr << (i == a.size() - 1 ? "":",");}cerr << "]\n"
#else
#define debug(...)
#define vecout(a)
#endif
#define mp make_pair
//struct doset{doset(int n){cout << fixed << setprecision(n);cerr << fixed << setprecision(n);}};
//struct myset{myset(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);}};
void myset(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
void doset(int n){cout << fixed << setprecision(n);}
void koko(){cerr << "koko\n";}
using ll = long long;
using ld = long double;
using dou = double;
const int inf = 1 << 30;
const ll INF = 1LL << 60;
const ld pi = 3.14159265358;
const ll mod1 = 1000000007LL;
const ll mod2 = 998244353LL;
typedef pair<ll,ll> P;
template<class T, class U> inline bool chmin(T& a, const U& b){ if(a > b){ a = b; return 1; } return 0; }
template<class T, class U> inline bool chmax(T& a, const U& b){ if(a < b){ a = b; return 1; } return 0; }
//nのm乗をMODで割ったあまりO(logm)
ll modpow(ll n,ll m,ll MOD){
    if(m == 0)return 1;
    if(m < 0)return 0;
    ll res = 1;
    n %= MOD;
    while(m){
        if(m & 1)res = (res * n) % MOD;
        m >>= 1;
        n *= n;
        n %= MOD;
    }
    return res;
}

ll mypow(ll n,ll m){
    if(m == 0)return 1;
    if(m < 0)return -1;
    ll res = 1;
    while(m){
        if(m & 1)res = (res * n);
        m >>= 1;
        n *= n;
    }
    return res;
}

//素数判定O(sqrt(N))
template<class T>
inline bool isp(T n){
    bool res = true;
    if(n == 1 || n == 0)return false;
    else{
        for(ll i = 2;i * i <= n;i++){
            if(n % i == 0){
                res = false;
                break;
            }
        }
        return res;
    }
}


inline bool Yes(bool b = 1){cout << (b ? "Yes\n":"No\n");return b;}
inline bool YES(bool b = 1){cout << (b ? "YES\n":"NO\n");return b;}


map<ll,ll> primefactor(ll n){
    map<ll,ll> ma;
    if(n <= 1)return ma;
    ll m = n;
    for(ll i = 2;i * i <= n;i++){
        while(m % i == 0){
            ma[i]++;
            m /= i;
        }
    }
    if(m != 1)ma[m]++;
    return ma;
}

ll __lcm(ll a,ll b){
    return a / __gcd(a,b) * b;
}


inline void in(){return;}
template<class First,class...Other>inline void in(First& F,Other&...O){cin >> F;in(O...);}

template<ll MOD = mod1>
struct fac_solver{
private:
    ll cmax;
    vector<ll> fac,finv,inv;
public:
    fac_solver(ll n = 100000):cmax(n),fac(n),finv(n),inv(n){
        fac[0] = fac[1] = 1;
        finv[0] = finv[1] = 1;
        inv[1] = 1;
        for (ll i = 2; i < cmax; i++){
            fac[i] = fac[i - 1] * i % MOD;
            inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
            finv[i] = finv[i - 1] * inv[i] % MOD;
        }
    }

    //二項係数計算nCk
    ll COM(ll n, ll k){
        if (n < k) return 0;
        if (n < 0 || k < 0) return 0;
        return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
    }

    ll PER(ll n,ll k){
        if(n < k || n < 0 || k < 0)return 0;
        return fac[n] * finv[n - k] % MOD;
    }

    ll stair_pow(ll n){return fac[n];}
};

/*----------------------------------マクロここまで----------------------------------*/

int N;
vector<int> wei;
int gobeki[] = {1,5,25,125,625,3125,15625};
void query(int from,int &r,int &weisum){
    cout << "? ";
    rep(i,from)cout << 0 << " ";
    int to = min(N,from + 6);
    rep(i,from,to){
        cout << gobeki[i - from] << (i == N - 1 ? "\n":" ");
        weisum += gobeki[i - from];
    }
    rep(i,to,N){
        cout << 0 << (i == N - 1 ? "\n":" ");
    }
    cout << flush;
    cin >> r;
}

int main(){
    myset();
    cin >> N;
    wei = vector<int>(N,8);
    rep(i,N){
        int res,w = 0;
        query(i,res,w);
        res -= w * 8;
        rep(j,i,min(N,int(i + 6))){
            wei[j] += res % 5;
            res /= 5;
        }
        i += 5;
    }
    cout << "! ";
    rep(i,N){
        cout << (wei[i] == 9 || wei[i] == 11 ? 1:0) << (i == N - 1 ? "\n":" ");
    }
    vecout(wei);
}

Submission Info

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

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
× 1
× 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 13 ms 3500 KB
subtask_1_1.txt 6 ms 3616 KB
subtask_1_10.txt 6 ms 3596 KB
subtask_1_11.txt 10 ms 3504 KB
subtask_1_12.txt 6 ms 3648 KB
subtask_1_13.txt 11 ms 3612 KB
subtask_1_14.txt 7 ms 3616 KB
subtask_1_15.txt 7 ms 3576 KB
subtask_1_16.txt 10 ms 3604 KB
subtask_1_17.txt 5 ms 3504 KB
subtask_1_18.txt 11 ms 3620 KB
subtask_1_19.txt 10 ms 3660 KB
subtask_1_2.txt 9 ms 3672 KB
subtask_1_20.txt 7 ms 3608 KB
subtask_1_21.txt 6 ms 3620 KB
subtask_1_22.txt 7 ms 3620 KB
subtask_1_23.txt 5 ms 3604 KB
subtask_1_24.txt 7 ms 3676 KB
subtask_1_25.txt 6 ms 3652 KB
subtask_1_26.txt 6 ms 3648 KB
subtask_1_27.txt 7 ms 3644 KB
subtask_1_28.txt 8 ms 3600 KB
subtask_1_29.txt 5 ms 3568 KB
subtask_1_3.txt 13 ms 3652 KB
subtask_1_4.txt 6 ms 3576 KB
subtask_1_5.txt 8 ms 3552 KB
subtask_1_6.txt 7 ms 3640 KB
subtask_1_7.txt 7 ms 3644 KB
subtask_1_8.txt 10 ms 3508 KB
subtask_1_9.txt 10 ms 3608 KB