Submission #488765

# Submission time Handle Problem Language Result Execution time Memory
488765 2021-11-20T11:55:28 Z Theo830 Hexagonal Territory (APIO21_hexagon) C++17
0 / 100
1440 ms 460 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 = A * ((((L[0] + 1) * (L[0] + 2)) / 2) % INF);
    ans %= INF;
    f(i,0,L[0] + 1){
        ans += (i * (i + 1) * B) % INF;
        ans %= INF;
    }
    sort(all(L));
    assert(L[0] == L.back());
    return ans;
}

# Verdict Execution time Memory Grader output
1 Incorrect 1433 ms 268 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1427 ms 268 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 460 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1440 ms 264 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 460 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1422 ms 268 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 332 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -