Submission #1668414


Source Code Expand

Copy
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

signed main(){
	int n;string s;cin>>n>>s;
	int cnt=0;
	rep(j,5){
		rep(i,s.size()-2){
			if(s[i]=='1'&&s[i+1]=='0'&&s[i+2]=='1'){
				cnt++;
				s[i]='0';s[i+1]='1';s[i+2]='0';
			}
		}
	}
	cout<<cnt<<endl;
}

Submission Info

Submission Time
Task D - 101 to 010
User autumn_eel
Language C++14 (GCC 5.4.1)
Score 0
Code Size 460 Byte
Status
Exec Time 29 ms
Memory 900 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 example0.txt, example1.txt
All 0 / 700 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, 024.txt, 025.txt, 026.txt, 027.txt, 028.txt, 029.txt, 030.txt, 031.txt, 032.txt, 033.txt, 034.txt, 035.txt, 036.txt, example0.txt, example1.txt
Case Name Status Exec Time Memory
000.txt 11 ms 644 KB
001.txt 7 ms 640 KB
002.txt 12 ms 644 KB
003.txt 8 ms 640 KB
004.txt 11 ms 640 KB
005.txt 14 ms 644 KB
006.txt 4 ms 384 KB
007.txt 7 ms 512 KB
008.txt 2 ms 256 KB
009.txt 17 ms 900 KB
010.txt 19 ms 900 KB
011.txt 22 ms 900 KB
012.txt 24 ms 900 KB
013.txt 26 ms 900 KB
014.txt 27 ms 900 KB
015.txt 28 ms 900 KB
016.txt 29 ms 900 KB
017.txt 28 ms 900 KB
018.txt 27 ms 900 KB
019.txt 24 ms 900 KB
020.txt 21 ms 900 KB
021.txt 21 ms 900 KB
022.txt 21 ms 900 KB
023.txt 21 ms 900 KB
024.txt 21 ms 900 KB
025.txt 21 ms 900 KB
026.txt 21 ms 900 KB
027.txt 21 ms 900 KB
028.txt 21 ms 900 KB
029.txt 21 ms 900 KB
030.txt 21 ms 900 KB
031.txt 21 ms 900 KB
032.txt 21 ms 900 KB
033.txt 21 ms 900 KB
034.txt 21 ms 900 KB
035.txt 22 ms 900 KB
036.txt 23 ms 900 KB
example0.txt 1 ms 256 KB
example1.txt 1 ms 256 KB