# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
257276 | kshitij_sodani | Rima (COCI17_rima) | C++14 | 174 ms | 67852 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 llo;
#define mp make_pair
#define pb push_back
#define a first
#define b second
int co=0;
int n;
int pre[3000001][26];
int val[3000001];
void insert(string s){
int cur=0;
for(int i=s.size()-1;i>=0;i--){
if(pre[cur][s[i]-'a']==0){
co+=1;
pre[cur][s[i]-'a']=co;
}
cur=pre[cur][s[i]-'a'];
}
val[cur]+=1;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin>>n;
for(int i=0;i<n;i++){
string s;
cin>>s;
// int x=s.size();
insert(s);
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |