Submission #3452590


Source Code Expand

#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <numeric>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <climits>
#include <cfloat>
#include <ctime>
#include <complex>
#include <cassert>
#include <array>
#include <bitset> 
#include <unordered_map>
#include <random>

using namespace std;
typedef long long LL;
typedef pair<int,int> P;

const int L=1e5+2;
char s[L];
vector<P> ret;
int main() {
	scanf("%s",s+1);
	int n=strlen(s+1);
	if(s[n]=='1'){
		puts("-1");
		return 0;
	}
	if(s[1]=='0'){
		puts("-1");
		return 0;
	}

	int cur=1;
	for(int i=1;i<n;i++){
		if(s[i]=='1'){
			if(s[n-i]=='0'){
				puts("-1");
				return 0;
			}
			while(cur<i){
				ret.push_back(P(cur,i));
				cur++;
			}
		}
	}
	ret.push_back(P(n-1,n));
	for(auto p:ret){
		printf("%d %d\n",p.first, p.second);
	}

	return 0;
}

Submission Info

Submission Time
Task E - Tr/ee
User kenimo
Language C++14 (GCC 5.4.1)
Score 700
Code Size 1057 Byte
Status AC
Exec Time 17 ms
Memory 2420 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:35:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
  scanf("%s",s+1);
                 ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 700 / 700
Status
AC × 3
AC × 48
Set Name Test Cases
Sample sample1_1111.txt, sample2_1110.txt, sample3_1010.txt
All 00-0.txt, 000.txt, 11-1.txt, 110.txt, bin.txt, bins.txt, fib.txt, one_0.txt, one_1.txt, one_2.txt, one_3.txt, rndNO1.txt, rndNO_0.txt, rndNO_1.txt, rndNO_2.txt, rndNO_3.txt, rndNO_4.txt, rndNO_5.txt, rndNOeven.txt, rndNOn.txt, rndNOodd.txt, rndYESeven_0.txt, rndYESeven_1.txt, rndYESeven_2.txt, rndYESeven_3.txt, rndYESeven_4.txt, rndYESeven_5.txt, rndYESeven_6.txt, rndYESeven_7.txt, rndYESeven_8.txt, rndYESeven_9.txt, rndYESodd_0.txt, rndYESodd_1.txt, rndYESodd_2.txt, rndYESodd_3.txt, rndYESodd_4.txt, rndYESodd_5.txt, rndYESodd_6.txt, rndYESodd_7.txt, rndYESodd_8.txt, rndYESodd_9.txt, sample1_1111.txt, sample2_1110.txt, sample3_1010.txt, star_0.txt, star_1.txt, star_2.txt, star_3.txt
Case Name Status Exec Time Memory
00-0.txt AC 2 ms 384 KB
000.txt AC 1 ms 256 KB
11-1.txt AC 1 ms 384 KB
110.txt AC 1 ms 256 KB
bin.txt AC 11 ms 1656 KB
bins.txt AC 1 ms 256 KB
fib.txt AC 16 ms 2292 KB
one_0.txt AC 16 ms 2420 KB
one_1.txt AC 16 ms 2420 KB
one_2.txt AC 16 ms 2420 KB
one_3.txt AC 16 ms 2420 KB
rndNO1.txt AC 1 ms 384 KB
rndNO_0.txt AC 1 ms 256 KB
rndNO_1.txt AC 1 ms 256 KB
rndNO_2.txt AC 1 ms 256 KB
rndNO_3.txt AC 1 ms 256 KB
rndNO_4.txt AC 1 ms 256 KB
rndNO_5.txt AC 1 ms 256 KB
rndNOeven.txt AC 2 ms 1400 KB
rndNOn.txt AC 1 ms 256 KB
rndNOodd.txt AC 1 ms 384 KB
rndYESeven_0.txt AC 1 ms 256 KB
rndYESeven_1.txt AC 1 ms 256 KB
rndYESeven_2.txt AC 2 ms 384 KB
rndYESeven_3.txt AC 1 ms 256 KB
rndYESeven_4.txt AC 2 ms 384 KB
rndYESeven_5.txt AC 6 ms 1020 KB
rndYESeven_6.txt AC 1 ms 256 KB
rndYESeven_7.txt AC 1 ms 256 KB
rndYESeven_8.txt AC 1 ms 256 KB
rndYESeven_9.txt AC 1 ms 256 KB
rndYESodd_0.txt AC 1 ms 256 KB
rndYESodd_1.txt AC 7 ms 1016 KB
rndYESodd_2.txt AC 2 ms 256 KB
rndYESodd_3.txt AC 1 ms 256 KB
rndYESodd_4.txt AC 1 ms 256 KB
rndYESodd_5.txt AC 1 ms 256 KB
rndYESodd_6.txt AC 1 ms 256 KB
rndYESodd_7.txt AC 3 ms 640 KB
rndYESodd_8.txt AC 1 ms 256 KB
rndYESodd_9.txt AC 1 ms 256 KB
sample1_1111.txt AC 1 ms 256 KB
sample2_1110.txt AC 1 ms 256 KB
sample3_1010.txt AC 1 ms 256 KB
star_0.txt AC 17 ms 2420 KB
star_1.txt AC 16 ms 2420 KB
star_2.txt AC 16 ms 2420 KB
star_3.txt AC 16 ms 2420 KB