Submission #312397

#TimeUsernameProblemLanguageResultExecution timeMemory
312397TricksterCollider (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]); } } }

Compilation message (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...