Submission #168079

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1680792019-12-11 09:28:35HungAnhGoldIBO2020Palindromes (APIO14_palindrome)C++14
47 / 100
617 ms101992 KiB
/*
abacaba
*/
#include<bits/stdc++.h>
#define int long long
#define hash hash1
using namespace std;
const int N=3e5+4;
const int mod=1610612741;
const int base=39;
int hash[N],rev_hash[N],mul[N],max1=1,sum[N];
map<int,int> cnt;
int gethash(int l,int r){
return (hash[r]-(hash[l-1]*mul[r-l+1])%mod+mod)%mod;
}
int gethash_rev(int l,int r){
return (rev_hash[l]-(rev_hash[r+1]*mul[r-l+1])%mod+mod)%mod;
}
struct node{
int nxt[26],len,suf;
};
node Eer[N];
int sz=0,lst;
string s;
void add(int idx){
// cout<<idx<<" BEGIN"<<endl;
int cha=(s[idx]-'a');
while(idx-Eer[lst].len-1<0||s[idx]!=s[idx-Eer[lst].len-1]){
lst=Eer[lst].suf;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

palindrome.cpp: In function 'void build(std::__cxx11::string)':
palindrome.cpp:60:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<s.size();i++){
              ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...