# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
491275 | AdamGS | Vim (BOI13_vim) | C++14 | 416 ms | 177452 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;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define pb push_back
#define st first
#define nd second
const int LIM=7e4+7, INF=1e9+7;
vector<pair<int,int>>S[LIM];
vector<pair<pair<int,int>,int>>V[LIM][10];
int kiedy[10], nxt[LIM][10], ostatni[LIM], odl[LIM][10];
int main() {
ios_base::sync_with_stdio(0); cin.tie(0);
int n, lst=-1;
string s;
cin >> n >> s;
rep(i, n) {
if(s[i]=='e') {
s[i]='a';
lst=i;
} else if(s[i]=='a') s[i]='e';
}
rep(i, 10) kiedy[i]=INF;
for(int i=n-1; i>=0; --i) {
rep(j, 10) nxt[i][j]=kiedy[j];
for(int j=1; j<10; ++j) if(kiedy[j]<INF) {
S[kiedy[j]].pb({j, 2});
}
if(i<n-1) S[i].pb({i+1, 1});
kiedy[s[i]-'a']=i;
ostatni[i]=INF;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |