답안 #488767

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
488767 2021-11-20T11:56:57 Z Theo830 육각형 영역 (APIO21_hexagon) C++17
9 / 100
1592 ms 332 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e9+7;
const ll MOD = 998244353;
typedef pair<ll,ll> ii;
#define iii pair<ii,ll>
#define f(i,a,b) for(ll i = a;i < b;i++)
#define pb push_back
#define vll vector<ll>
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
///I hope I will get uprating and don't make mistakes
///I will never stop programming
///sqrt(-1) Love C++
///Please don't hack me
///@TheofanisOrfanou Theo830
///Think different approaches (bs,dp,greedy,graphs,shortest paths,mst)
///Stay Calm
///Look for special cases
///Beware of overflow and array bounds
///Think the problem backwards
///APIO 2021 vc
#include "hexagon.h"
int draw_territory(int N, int A, int B,std::vector<int> D, std::vector<int> L){
    ll ans = ((((L[0] + 1) * 1LL * (L[0] + 2)) / 2) % INF);
    ans *= A;
    ans %= INF;
    f(i,0,L[0] + 1){
        ans += (((i * (i + 1)) % INF) * B) % INF;
        ans %= INF;
    }
    sort(all(L));
    assert(L[0] == L.back());
    return ans;
}

# 결과 실행 시간 메모리 Grader output
1 Correct 1395 ms 264 KB Output is correct
2 Correct 1408 ms 272 KB Output is correct
3 Correct 1 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 1434 ms 268 KB Output is correct
2 Correct 1378 ms 268 KB Output is correct
3 Correct 1380 ms 268 KB Output is correct
4 Correct 1401 ms 276 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 0 ms 208 KB Output is correct
8 Correct 1 ms 208 KB Output is correct
9 Correct 1 ms 208 KB Output is correct
10 Correct 0 ms 208 KB Output is correct
11 Correct 0 ms 208 KB Output is correct
12 Correct 1 ms 208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1513 ms 268 KB Output is correct
2 Correct 1532 ms 264 KB Output is correct
3 Runtime error 1 ms 332 KB Execution killed with signal 6
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1592 ms 264 KB Output is correct
2 Correct 1489 ms 268 KB Output is correct
3 Correct 1444 ms 264 KB Output is correct
4 Correct 1435 ms 276 KB Output is correct
5 Incorrect 300 ms 276 KB Output isn't correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -