Submission #6792883


Source Code Expand

Copy
//codth2017_e.cpp
//Sat Aug 10 11:28:53 2019

#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define INTINF 2147483647
#define LLINF 9223372036854775807
using namespace std;
using ll=long long;
typedef pair<int,int> P;

int main(){
	int n;
	cin >> n;

	int ans[n];
	fill(ans,ans+n,-1);

	int count = 1;
	while (count <= n){
		cout << "? ";
		for (int i=1;i<count;i++){
			cout << "0 ";
		}
		int maisu = 1;
		while (count<=n){
			cout << maisu << " ";
			maisu = maisu*10;
			if (maisu==100000){
				break;
			}
		}
		for (int i=count+5;i<=n;i++){
			cout << "0 ";
		}
		printf("\n");

		int response = 0;
		cin >> response;
		while (response>0){
			if (response%10==8){
				ans[count-1] = 0;
				response = (response-8)/10;
			}else if (response%10==9){
				ans[count-1] = 1;
				response = (response-9)/10;
			}else if (response%10==0){
				ans[count-1] = 0;
				response = (response-10)/10;
			}else if (response%10==1){
				ans[count-1] = 1;
				response = (response-11)/10;
			}else if (response%10==2){
				ans[count-1] = 0;
				response = (response-12)/10;
			}
			count++;
//			cout << "response" << endl;
		}
	}

	cout << "! ";
	for (int i=0;i<n;i++){
		cout << ans[i] << " ";
	}
	printf("\n");

	fflush(stdout);
	return 0;
}

Submission Info

Submission Time
Task E - Coin Authentication
User hornistyf
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1430 Byte
Status TLE
Exec Time 2111 ms
Memory 724 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 1
AC × 16
TLE × 14
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 3 ms 720 KB
subtask_1_1.txt TLE 2103 ms 720 KB
subtask_1_10.txt TLE 2103 ms 720 KB
subtask_1_11.txt AC 10 ms 596 KB
subtask_1_12.txt AC 3 ms 592 KB
subtask_1_13.txt TLE 2103 ms 720 KB
subtask_1_14.txt TLE 2103 ms 724 KB
subtask_1_15.txt TLE 2103 ms 596 KB
subtask_1_16.txt TLE 2111 ms 724 KB
subtask_1_17.txt AC 10 ms 724 KB
subtask_1_18.txt AC 3 ms 592 KB
subtask_1_19.txt AC 3 ms 720 KB
subtask_1_2.txt TLE 2103 ms 720 KB
subtask_1_20.txt AC 10 ms 724 KB
subtask_1_21.txt AC 3 ms 720 KB
subtask_1_22.txt AC 3 ms 716 KB
subtask_1_23.txt AC 3 ms 596 KB
subtask_1_24.txt AC 3 ms 720 KB
subtask_1_25.txt AC 3 ms 596 KB
subtask_1_26.txt TLE 2103 ms 720 KB
subtask_1_27.txt AC 3 ms 592 KB
subtask_1_28.txt TLE 2103 ms 724 KB
subtask_1_29.txt AC 3 ms 592 KB
subtask_1_3.txt TLE 2103 ms 720 KB
subtask_1_4.txt TLE 2103 ms 720 KB
subtask_1_5.txt TLE 2103 ms 724 KB
subtask_1_6.txt AC 10 ms 724 KB
subtask_1_7.txt TLE 2103 ms 724 KB
subtask_1_8.txt TLE 2103 ms 720 KB
subtask_1_9.txt AC 14 ms 596 KB