Submission #335104

# Submission time Handle Problem Language Result Execution time Memory
335104 2020-12-11T06:59:48 Z nicholask Street Lamps (APIO19_street_lamps) C++14
0 / 100
1 ms 384 KB
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n,q;
	cin>>n>>q;
	if (n<=100&&q<=100){
		vector <string> v;
		string st;
		cin>>st;
		for (int z=1; z<=q; z++){
			string s;
			cin>>s;
			if (s=="toggle"){
				int u;
				cin>>u;
				u--;
				if (st[u]=='0') st[u]='1';
				else st[u]='0';
			} else {
				v.push_back(st);
				int t,u;
				cin>>t>>u;
				t--;
				u--;
				int cnt=0;
				for (auto&i:v){
					bool ok=1;
					for (int j=t; j<u; j++){
						if (i[j]!='1'){
							ok=0;
							break;
						}
					}
					if (ok) cnt++;
				}
				cout<<cnt<<endl;
			}
		}
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -