General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
59356798 Practice:
_manoj
1204D2 - 25 GNU C++14 Wrong answer on test 4 15 ms 4 KB 2019-08-23 16:49:14 2019-08-23 16:49:14
 
 
→ Source
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	string s;
	cin>>s;
	ll i,j,k,n,zer=0,one=0,t1,t2;
	n=s.size();
	char res[n];
	for(i=0;i<n;i++)
		res[i]='0';
	for(i=0;i<n-1;i++)
	{
		if(s[i]=='1' and s[i+1]=='0')
		{
			t1=i;
			t2=i+1;
			res[t1]='1';
			//res[t2]='0';
			while(t1>=0 and t2<n and (s[t1-1]=='1' and s[t2+1]=='0'))
			{
				//res[t2]='0';
				t1--;
				t2++;
				res[t1]='1';
			}
			i=t2-1;
		}
	}
	for(i=0;i<n;i++)
		cout<<res[i];
}
 
 
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details