#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
384 KB |
Output isn't correct |
4 |
Incorrect |
174 ms |
67852 KB |
Output isn't correct |
5 |
Incorrect |
20 ms |
3456 KB |
Output isn't correct |
6 |
Incorrect |
27 ms |
32404 KB |
Output isn't correct |
7 |
Incorrect |
35 ms |
32164 KB |
Output isn't correct |
8 |
Incorrect |
26 ms |
32224 KB |
Output isn't correct |
9 |
Incorrect |
51 ms |
35488 KB |
Output isn't correct |
10 |
Incorrect |
26 ms |
32256 KB |
Output isn't correct |