100832024-03-26 17:18:51111Génsebészcpp17Time limit exceeded 0/100300ms6724 KiB
#ifdef ONLINE_JUDGE
#include "grader.h"
#endif

#include <bits/stdc++.h>
using namespace std;

string DNS;

void Kezd(string S){
	DNS=S;
}

void Beszur(int i,char x){
	DNS.insert(DNS.begin()+i,x);
}

void Mutal(int i,char x){
	DNS[i-1]=x;
}

void Kivag(int i,int j){
	DNS.erase(i-1,j-i+1);
}

int Szamlal(int i,int j,char x){
	return count(DNS.begin()+i-1,DNS.begin()+j,x);
}

string Eredmeny(){
	return DNS;
}

#ifndef ONLINE_JUDGE
int main(){
	freopen("be1.txt","r",stdin);
	string S;
	cin>>S;
	Kezd(S);
	while(true){
		int o;
		cin>>o;
		if(o==0){
			break;
		}
		if(o==1){
			int i;
			char x;
			cin>>i>>x;
			Beszur(i,x);
		}
		if(o==2){
			int i;
			char x;
			cin>>i>>x;
			Mutal(i,x);
		}
		if(o==3){
			int i,j;
			cin>>i>>j;
			Kivag(i,j);
		}
		if(o==4){
			int i,j;
			char x;
			cin>>i>>j>>x;
			int res=Szamlal(i,j,x);
			int ans;
			cin>>ans;
			ans--;
			if(res!=ans){
				cout<<"got "<<res<<'\n';
				cout<<"exp "<<ans<<'\n';
				return 1;
			}
		}
		if(o==5){
			string res=Eredmeny();
			string ans;
			cin>>ans;
			ans.pop_back();
			if(res!=ans){
				cout<<"got "<<res<<'\n';
				cout<<"exp "<<ans<<'\n';
				return 1;
			}
		}
	}
	return 0;
}
#endif
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1808 KiB
2Accepted3ms1952 KiB
subtask20/30
3Accepted3ms2160 KiB
4Accepted3ms2288 KiB
5Accepted3ms2524 KiB
6Accepted3ms2640 KiB
7Accepted4ms3064 KiB
8Time limit exceeded300ms2736 KiB
subtask30/30
9Accepted3ms3488 KiB
10Accepted3ms3600 KiB
11Accepted3ms3876 KiB
12Accepted3ms3968 KiB
13Accepted4ms4256 KiB
14Time limit exceeded300ms4248 KiB
subtask40/20
15Accepted3ms5152 KiB
16Accepted3ms5360 KiB
17Accepted3ms5580 KiB
18Accepted3ms5820 KiB
19Time limit exceeded298ms5836 KiB
subtask50/20
20Accepted3ms6392 KiB
21Accepted3ms6432 KiB
22Accepted3ms6428 KiB
23Accepted4ms6488 KiB
24Time limit exceeded300ms6724 KiB