답안 #533361

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
533361 2022-03-05T16:47:42 Z DanerZein 육각형 영역 (APIO21_hexagon) C++14
9 / 100
1 ms 296 KB
#include "hexagon.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
ll pot(ll b,ll e){
  if(e==1) return b;
  ll aux=pot(b,e/2);
  aux*=aux; aux%=mod;
  if(e%2!=0) aux=(aux*b)%mod;
  return aux;
}
int draw_territory(int N, int A, int B,
                   std::vector<int> D, std::vector<int> L) {
  ll n=L[0];
  ll nh=(ll)(L[0]+1)*(ll)(L[0]+2);
  nh%=mod;
  nh*=pot(2,mod-2); nh%=mod;
  ll ans=nh*A; ans%=mod;
  ll i2=n*(ll)(2*n+1); i2%=mod;
  i2*=(ll)(n+1); i2%=mod;
  i2*=pot(6,mod-2); i2%=mod;
  ll i=n*(ll)(n+1); i%=mod;
  i*=pot(2,mod-2); i%=mod;
  ll b=(i+i2)%mod;
  b*=B; b%=mod;
  ans+=b; ans%=mod;
  return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 260 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 0 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct
11 Correct 0 ms 204 KB Output is correct
12 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Incorrect 1 ms 296 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -