# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
862846 | willychan | Copy and Paste 3 (JOI22_copypaste3) | C++14 | 401 ms | 97508 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 ll;
//#include<bits/extc++.h>
//__gnu_pbds
#define int ll
const int N = 2505;
ll dp[N][N]; string s;
int a,b,c;
int h[N][N];
const int MOD = 712271227;
const int P = 101;
int hsh[N];
int ppow[N];
int get(int l,int r){
ll ans = hsh[r];
ans = (ans-(1LL*hsh[l-1]*ppow[r-l+1])%MOD)%MOD;
if(ans<0) ans+=MOD;
return ans;
}
signed main(){
ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
int n;cin>>n;
cin>>s;
cin>>a>>b>>c;
ppow[0]=1;
for(int i=1;i<=n;i++){
hsh[i] = (1LL*hsh[i-1]*P)%MOD;
hsh[i]+=(s[i-1]-'a');
hsh[i]%=MOD;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |