Submission #1668383


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(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 438 Byte
Status
Exec Time 20 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 9 ms 644 KB
001.txt 6 ms 640 KB
002.txt 9 ms 644 KB
003.txt 6 ms 640 KB
004.txt 8 ms 640 KB
005.txt 10 ms 644 KB
006.txt 3 ms 384 KB
007.txt 6 ms 512 KB
008.txt 1 ms 256 KB
009.txt 15 ms 900 KB
010.txt 17 ms 900 KB
011.txt 18 ms 900 KB
012.txt 18 ms 900 KB
013.txt 19 ms 900 KB
014.txt 20 ms 900 KB
015.txt 20 ms 900 KB
016.txt 20 ms 900 KB
017.txt 20 ms 900 KB
018.txt 19 ms 900 KB
019.txt 19 ms 900 KB
020.txt 17 ms 900 KB
021.txt 18 ms 900 KB
022.txt 18 ms 900 KB
023.txt 18 ms 900 KB
024.txt 19 ms 900 KB
025.txt 19 ms 900 KB
026.txt 19 ms 900 KB
027.txt 19 ms 900 KB
028.txt 19 ms 900 KB
029.txt 19 ms 900 KB
030.txt 19 ms 900 KB
031.txt 19 ms 900 KB
032.txt 19 ms 900 KB
033.txt 19 ms 900 KB
034.txt 19 ms 900 KB
035.txt 19 ms 900 KB
036.txt 19 ms 900 KB
example0.txt 1 ms 256 KB
example1.txt 1 ms 256 KB