Submission #743370

# Submission time Handle Problem Language Result Execution time Memory
743370 2023-05-17T10:42:14 Z onebit1024 Hexagonal Territory (APIO21_hexagon) C++17
3 / 100
1 ms 292 KB
#include "hexagon.h"
#define ll long long
#include <vector>
ll mod = 1e9+7;
ll ma(ll a, ll b){
  return (a+b)%mod;
}
ll mm(ll a, ll b){
  return (a*b)%mod;
}
int draw_territory(int N, int A, int B,
                   std::vector<int> D, std::vector<int> L) {
  ll k = L[0]-2;
  if(L[0]<=2)return mm(A,L[0]*3)%mod;
  ll fr = mm(L[0],3),sr=0;
  if(k%2)sr = mm((k+1)/2,k);
  else sr = mm(k/2,k+1);
  return mm(A,ma(sr,fr))%mod;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 284 KB Output is correct
3 Correct 1 ms 292 KB Output is correct
4 Correct 0 ms 288 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 288 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 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 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 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 0 ms 212 KB Output is correct
3 Incorrect 0 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 -