# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1060968 | 12345678 | Copy and Paste 3 (JOI22_copypaste3) | C++17 | 741 ms | 836508 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;
#define ll long long
#define int long long
const ll nx=2505, mod=1e9+7, mul=31;
ll n, a, b, c, s[nx], dp[nx][nx], pw[nx];
string stmp;
struct update
{
ll l, r, cnta, cntc;
update(ll l=0, ll r=0, ll cnta=0, ll cntc=0): l(l), r(r), cnta(cnta), cntc(cntc){}
};
vector<update> calc[nx][nx];
int32_t main()
{
cin.tie(NULL)->sync_with_stdio(false);
cin>>n>>stmp>>a>>b>>c;
pw[0]=1;
for (int i=1; i<=n; i++) s[i]=stmp[i-1]-'a'+1, pw[i]=(pw[i-1]*mul)%mod;
for (int sz=1; sz<=n; sz++)
{
map<ll, vector<ll>> mp;
ll sm=0;
for (int i=1; i<=sz; i++) sm=(sm+pw[sz-i]*s[i])%mod;
Compilation message (stderr)
# | 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... |