제출 #312397

#제출 시각아이디문제언어결과실행 시간메모리
312397Trickster입자 가속기 (IZhO11_collider)C++98
0 / 100
2065 ms1436 KiB
//Just try and the idea will come
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	int n,m,l,r;
	cin>>n>>m>>s;
	char ch;
	while(m--){
		cin>>ch;
		if(ch=='a'){
			scanf("%d%d",&l,&r);
			l--;
			r--;
			string c="";
			c=s[l];
			s.erase(l, 1);
			s.insert(r,c);
		}
		else{
			scanf("%d", &l);
			l--;
			printf("%c\n", s[l]);
		}
	}
	
}

컴파일 시 표준 에러 (stderr) 메시지

collider.cpp: In function 'int main()':
collider.cpp:12:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   12 |    scanf("%d%d",&l,&r);
      |    ~~~~~^~~~~~~~~~~~~~
collider.cpp:21:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   21 |    scanf("%d", &l);
      |    ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...