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;
const __int128 modulo = 1e9+7;
const __int128 inverse2 = 500000004;
const __int128 inverse3 = 333333336;
int draw_territory(int N, int A, int B,
std::vector<int> D, std::vector<int> L) {
__int128 len = L[0]+1ll;
return (int)((len*(len+1)*inverse2*__int128(A) + (((len-1)*len*(len+1))%modulo)*inverse3*__int128(B))%modulo);
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |