Submission #556673

# Submission time Handle Problem Language Result Execution time Memory
556673 2022-05-03T14:30:47 Z josanneo22 Hexagonal Territory (APIO21_hexagon) C++17
3 / 100
1591 ms 340 KB
#include "hexagon.h"
#include <vector>

#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<stdlib.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pair<int, int> > vpii;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b); i > (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

#define mp make_pair
#define pb push_back
#define rsz resize
#define sz(x) int(x.size())
#define all(x) begin(x), end(x)
#define f first
#define s second
#define out(x) cout<<x;
#define in(x) cin>>x;
#define inarr(a,x,y) for(int i=x;i<y;i++){cin>>a[i];}
#define incor(a,x,y) for(int i=x;i<y;i++){cin>>a[i].f>>a[i].s;}
int dx[4] = { -1, 0, 1, 0 };
int dy[4] = { 0, 1, 0, -1 };
const int mod = 1e9 + 7;

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) % mod);
    ans *= A;
    ans %= mod;
    FOR(i,0,L[0] + 1)
	{
        ans += (((i * (i + 1)) % mod) * B) % mod;
        ans %= mod;
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 1561 ms 276 KB Output is correct
2 Correct 1534 ms 284 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 296 KB Output is correct
5 Correct 1 ms 296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1551 ms 280 KB Output is correct
2 Correct 1574 ms 276 KB Output is correct
3 Incorrect 1552 ms 276 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 Incorrect 1 ms 300 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1591 ms 280 KB Output is correct
2 Correct 1586 ms 280 KB Output is correct
3 Incorrect 1 ms 340 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 1581 ms 280 KB Output is correct
2 Correct 1566 ms 212 KB Output is correct
3 Incorrect 1557 ms 280 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 -