Submission #555477

# Submission time Handle Problem Language Result Execution time Memory
555477 2022-05-01T04:29:00 Z joelau Hexagonal Territory (APIO21_hexagon) C++14
9 / 100
1 ms 340 KB
#include "hexagon.h"
#include <bits/stdc++.h>
using namespace std;

long long m = 1000000007;

long long fastexp (long long a, long long b) {
    long long ans = 1;
    while (b) {
        if (b & 1) ans = ans * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return ans;
}

int draw_territory(int N, int A, int B, vector<int> D, vector<int> L) {
    return ((long long) (A-B+m) * (L[0]+1) % m * (L[0]+2) % m * fastexp(2,m-2) + (long long) B * (L[0]+1) % m * (L[0]+2) % m * (L[0]*2+3) % m * fastexp(6,m-2)) % m;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 216 KB Output is correct
4 Correct 1 ms 216 KB Output is correct
5 Correct 1 ms 216 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 232 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 308 KB Output is correct
5 Correct 0 ms 216 KB Output is correct
6 Correct 1 ms 216 KB Output is correct
7 Correct 0 ms 216 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 308 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 308 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 300 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Incorrect 1 ms 212 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 308 KB Output isn't correct
2 Halted 0 ms 0 KB -