| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 1079436 | Trumling | Crayfish scrivener (IOI12_scrivener) | C++14 | 105 ms | 22956 KiB | 
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std; 
typedef long long ll;
#define pb push_back
#define F first
#define S second
#define enter cout<<'\n';
#define INF 99999999999999999
#define MOD 1000000007
#define all(x) x.begin(),x.end()
string s;
bool tf=0;
vector<pair<ll,char>>v;
void Init() 
{
}
void TypeLetter(char L) {
  
  v.pb({v.size()-1,L});
}
void UndoCommands(int U) {
  v.pb({v.size()-U-1,'?'});
}
char GetLetter(int P) {
  if(!tf)
  {
    ll idx=v.size()-1;
    while(idx!=-1)
    {
    if(v[idx].S!='?')
      s+=v[idx].S;
    idx=v[idx].F;
    }
    for(int i=0;i<s.size()/2;i++)
      swap(s[i],s[s.size()-1-i]);
    tf=1;
  }
  assert(P<s.size());
  return s[P];
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
