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 "hexagon.h"
#include<bits/stdc++.h>
#define sz size()
#define ll long long
using namespace std;
const ll M = 1e9 + 7;
int draw_territory(int N, int A, int B, vector<int> D, vector<int> L)
{
ll l = L[0] + 1;
ll ans = 0;
if(l % 3 == 0) ans = l / 3 * (l - 1) % M * (l + 1) % M;
if(l % 3 == 1) ans = (l - 1) / 3 * l % M * (l + 1) % M;
if(l % 3 == 2) ans = (l + 1) / 3 * l % M * (l - 1) % M;
ans = ans * B % M;
ll res = 0;
res = l * (l + 1) / 2 % M * (ll)A % M;
res = (res + ans) % M;
return int(res);
}
//void solve()
//{
//}
//
//signed main()
//{
// ios_base::sync_with_stdio(0);
// cin.tie(0), cout.tie(0);
//// solve();
//}
# | 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... |