Submission #4723793


Source Code Expand

Copy
#include<algorithm>
#include<complex>
#include<ctype.h>
#include<iomanip>
#include<iostream>
#include<fstream>
#include<map>
#include<math.h>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<stdio.h>
#include<string>
#include<string>
#include<vector>

using namespace std;
typedef long long ll;

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("Yes")
#define p_no() p("No")

const ll mod = 1e9 + 7;
const ll inf = 1e18;

template < typename T >
void vprint(T &V){
	for(auto v : V){
    	cout << v << " ";
	}
	cout << endl;
}

void send_query(vector<ll> query){
    cout << '?';
    for(ll q : query){
        cout << ' ' << q;
    }
    cout << endl;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    // input
    ll N;
    cin >> N;

    ll query_num;
    if(N%5==0){
        query_num = N/5;
    }else{
        query_num = N/5 + 1;
    }

    vector<ll> answer(N);
    vector<ll> query(N);
    FOR(i, 0, query_num){
        fill(ALL(query), 0);

        ll base = i*5;
        FOR(j, 0, 5){
            ll index = i*5 + j;
            if(index<N){
                query[index] = pow(10, j);
            }
        }

        send_query(query);

        ll ans;
        cin >> ans;

        FOR(j, 0, 5){
            if(ans%10==9){
                answer[base+j] = 1;
                ans -= 9;
            }
            else if(ans%10==1){
                answer[base+j] = 1;
                ans -= 11;
            }
            else if(ans%10==8){
                answer[base+j] = 0;
                ans -= 8;
            }
            else if(ans%10==0){
                answer[base+j] = 0;
                ans -= 10;
            }
            else if(ans%10==2){
                answer[base+j] = 0;
                ans -= 12;
            }
            ans /= 10;
        }
    }

    cout << '!';
    FOR(i, 0, N){
        cout << " " << answer[i];
    }
    cout << endl;

    return 0;
}

Submission Info

Submission Time
Task E - Coin Authentication
User peroon
Language C++14 (GCC 5.4.1)
Score 400
Code Size 2134 Byte
Status
Exec Time 99 ms
Memory 852 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 4 ms 852 KB
subtask_1_1.txt 99 ms 716 KB
subtask_1_10.txt 99 ms 716 KB
subtask_1_11.txt 3 ms 724 KB
subtask_1_12.txt 3 ms 592 KB
subtask_1_13.txt 3 ms 720 KB
subtask_1_14.txt 3 ms 724 KB
subtask_1_15.txt 99 ms 724 KB
subtask_1_16.txt 99 ms 724 KB
subtask_1_17.txt 3 ms 720 KB
subtask_1_18.txt 3 ms 724 KB
subtask_1_19.txt 3 ms 720 KB
subtask_1_2.txt 99 ms 720 KB
subtask_1_20.txt 4 ms 724 KB
subtask_1_21.txt 3 ms 724 KB
subtask_1_22.txt 3 ms 596 KB
subtask_1_23.txt 3 ms 596 KB
subtask_1_24.txt 3 ms 596 KB
subtask_1_25.txt 3 ms 724 KB
subtask_1_26.txt 3 ms 724 KB
subtask_1_27.txt 3 ms 596 KB
subtask_1_28.txt 3 ms 588 KB
subtask_1_29.txt 3 ms 596 KB
subtask_1_3.txt 3 ms 716 KB
subtask_1_4.txt 99 ms 724 KB
subtask_1_5.txt 3 ms 720 KB
subtask_1_6.txt 3 ms 724 KB
subtask_1_7.txt 3 ms 720 KB
subtask_1_8.txt 99 ms 724 KB
subtask_1_9.txt 3 ms 724 KB