Submission #1042038

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10420382024-08-02 13:04:37PM1Dabbeh (INOI20_dabbeh)C++17
0 / 100
284 ms55056 KiB
#include <bits/stdc++.h>
using namespace std;
const int mxn=3e5+5;
int n,m,l,r,trie[mxn*2][26],cnt=0,sz[mxn*2],par[mxn*2];
string s[mxn],a;
vector<int>v;
void add(int d,int x,int i){
if(d==s[i].size())
return ;
if(trie[x][s[i][d]-'a']==0){
trie[x][s[i][d]-'a']=++cnt;
par[cnt]=x;
}
sz[trie[x][s[i][d]-'a']]++;
add(d+1,trie[x][s[i][d]-'a'],i);
}
void up(int x){
while(x!=0){
sz[x]++;
x=par[x];
}
}
void get(int x=0){
//cout<<x<<" ";
if(l==r+1 || trie[x][a[l]-'a']==0 || sz[trie[x][a[l]-'a']]==0 ){
v.push_back(x);
if(x==0)
l=1e9;
return;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In function 'void add(int, int, int)':
Main.cpp:8:6: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |  if(d==s[i].size())
      |     ~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...