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 <vector>
using namespace std;
typedef vector<int> vi;
const int MD = 1000000007, V2 = 500000004, V6 = 166666668;
int choose2(int n) {
return (long long) n * (n - 1) % MD * V2 % MD;
}
int choose3(int n) {
return (long long) n * (n - 1) % MD * (n - 2) % MD * V6 % MD;
}
int draw_territory(int n, int a, int b, vi dd, vi ll) {
int c = choose2(ll[0] + 2), d = choose3(ll[0] + 2) * 2 % MD;
return ((long long) c * a + (long long) d * b) % MD;
}
# | 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... |