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>
#include <vector>
#define debu(x) (cerr << #x << " = "<< x << "\n")
#define moddy 1000000007
using namespace std;
int draw_territory(int N, int A, int B, std::vector<int> D, std::vector<int> L)
{
#define int __int128
int leng = L[0] + 1;
leng %= moddy; //:))
int ans = leng * ((leng + 1) %moddy) * (2 * leng + 1)/6;
ans -= leng*(leng + 1)/2;
ans *= B;
//debu(ans);
ans += A * (leng * (leng + 1))/2;
//debu(ans);
#undef int
return (ans%moddy);
}
# | 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... |