Submission #566945

# Submission time Handle Problem Language Result Execution time Memory
566945 2022-05-23T06:44:13 Z Mazaalai Hexagonal Territory (APIO21_hexagon) C++17
3 / 100
1 ms 304 KB
#include "hexagon.h"

#include <bits/stdc++.h>
using ll = long long;
using namespace std;

int dx[] = {-1, 0, 1, 1, 0, -1};
int dy[] = {0, 1, 1, 0, -1, -1};
int n, A, B;
const int MOD = 1e9 + 7;
int draw_territory(int _n, int _A, int _B, std::vector<int> d, std::vector<int> l) {
    n = _n;
    A = _A;
    B = _B;
    if (n == 3) {
        ll x = l[0];
        return (
            ( (x+1) * (x+2) / 2 % MOD * A % MOD) + 
            (B * 
                (
                    (x * (x+1) / 2) % MOD + 
                    x * (x + 1) * (x + x + 1) / 6) % MOD
                )
        )%MOD;
    }
    return 0;
}
# 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 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 304 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 300 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 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 304 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 212 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 212 KB Output isn't correct
2 Halted 0 ms 0 KB -