# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
998622 | kirilchay | Three Friends (BOI14_friends) | C++17 | 42 ms | 35572 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;
#define pb push_back
const ll MOD=1e9+7;
const ll L=79;
const ll N =2e6+7;
ll h[N+2],hd[N+2];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll n;
cin >> n;
string s ;
cin >> s;
h[0]=1;
for(ll i=1;i<=N;i++)
{
h[i]=(h[i-1]*L)%MOD;
}
hd[0]=0;
for(ll i=1;i<=n;i++)
{
hd[i]=(((s[i-1]*h[i-1])%MOD)+hd[i-1])%MOD;
}
ll sm = 0;
string ss;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |