Submission #173610

#TimeUsernameProblemLanguageResultExecution timeMemory
173610juggernautCollider (IZhO11_collider)C++14
100 / 100
722 ms3500 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]
    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]
    scanf("%d", &l);
    ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...