# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
845238 | vjudge1 | Trener (COCI20_trener) | C++17 | 222 ms | 17396 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 pb push_back
#define endl "\n"
#define int long long
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
const int MOD = (int) 1e9 + 7;
const int MOD2 = (int) 1e9 + 9;
int P = 29;
int add(int a,int b){
if(a+b>=MOD) return a+b-MOD;
return a+b;
}
int mult(int a,int b){
if(a*b>=MOD) return a*b%MOD;
return a*b;
}
array<int,3> get_hash(string s){
int res=0LL;
for(int i=0;i<sz(s)-1;i++)
{
res=mult(res,P);
res=add(res,s[i]-'a'+1);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |