# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
45134 | nibnalin | Three Friends (BOI14_friends) | C++17 | 76 ms | 6620 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 <iostream>
#include <cstdio>
#include <vector>
using namespace std;
const int maxn = int(2e5)+5, MOD = int(1e9)+7, charsz = 29;
int n;
string S;
pair<int, int> st[4*maxn+10];
int modpow(int a, int b)
{
if(!b) return 1;
else
{
int res = modpow(a, b/2);
res *= res;
res %= MOD;
if(b%2) res *= a%MOD;
return res%MOD;
}
}
pair<int, int> combine(pair<int, int> a, pair<int, int> b)
{
pair<int, int> res = {a.first, a.second+b.second};
res.first += (b.first%MOD*modpow(charsz, a.second)%MOD)%MOD;
res.first %= MOD;
return res;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |