Submission #994788

# Submission time Handle Problem Language Result Execution time Memory
994788 2024-06-08T05:44:31 Z thelegendary08 Hexagonal Territory (APIO21_hexagon) C++14
3 / 100
1 ms 348 KB
#include "hexagon.h"
#include<bits/stdc++.h>
#define ll long long int

using namespace std;
const ll mod = 1e9 + 7;
int draw_territory(int N, int A, int B, std::vector<int> D, std::vector<int> L) {
    ll n = L[0] + 1;
    ll sz = n * (n + 1)/2;
    sz %= mod;
    ll sdist = 0;
    sdist += n * (n+1) % mod * (2*n+1) % mod / 6 % mod;
    sdist += n * (n+1) / 2 % mod;
    sdist %= mod;
	ll ans = (sz * A % mod) + (sdist * B % mod);
	return ans % mod;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -