Submission #567102

# Submission time Handle Problem Language Result Execution time Memory
567102 2022-05-23T08:04:24 Z Bill_00 Hexagonal Territory (APIO21_hexagon) C++14
30 / 100
45 ms 4676 KB
#include "hexagon.h"
#include <bits/stdc++.h>
#include <vector>
typedef long long ll;
const ll MOD = 1000000007;
const ll low = -1000000000;
using namespace std;

ll area, bound, x, y;
int draw_territory(int N, int A, int B, vector<int> D, vector<int> L){
    if(B == 0){
        for(int i = 0; i < N; i++){
            ll val = L[i];
            bound += val;
            if(D[i] == 1){
                y += val;
            }
            if(D[i] == 2){
                area += ((2 * y * val));
                x += val;
            }
            if(D[i] == 3){
                area += (((2 * y - val) * val));
                x += val;
                y -= val;
   
            }
            if(D[i] == 4){
                y -= val;
            }
            if(D[i] == 5){
                area -= ((2 * y * val));
                x -= val;
            }
            if(D[i] == 6){
                area -= (((2 * y + val) * val));
                x -= val;
                y += val;
            }
        }
        // cout << area << "\n";
        if(area < 0) area = abs(area);
        // if(area != (L[0] * L[0])) while(1);
        // cout << area << '\n';
        ll inter = ((area - bound) / 2 + 1) % MOD;
        ll a = A;
        return (((inter + bound) * a) % MOD);
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 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 1 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 0 ms 212 KB Output is correct
2 Correct 3 ms 436 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 316 KB Output is correct
6 Correct 2 ms 468 KB Output is correct
7 Correct 7 ms 820 KB Output is correct
8 Correct 1 ms 320 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 12 ms 1236 KB Output is correct
12 Correct 10 ms 1284 KB Output is correct
13 Correct 9 ms 1100 KB Output is correct
14 Correct 10 ms 1316 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 1 ms 304 KB Output is correct
17 Correct 1 ms 216 KB Output is correct
18 Correct 1 ms 216 KB Output is correct
19 Correct 1 ms 216 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 240 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 3 ms 400 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 300 KB Output is correct
7 Correct 2 ms 340 KB Output is correct
8 Correct 3 ms 468 KB Output is correct
9 Correct 6 ms 820 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 312 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 9 ms 1208 KB Output is correct
14 Correct 10 ms 1192 KB Output is correct
15 Correct 10 ms 1108 KB Output is correct
16 Correct 10 ms 1320 KB Output is correct
17 Correct 1 ms 304 KB Output is correct
18 Correct 1 ms 304 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 16 ms 2104 KB Output is correct
21 Correct 2 ms 468 KB Output is correct
22 Correct 1 ms 312 KB Output is correct
23 Correct 19 ms 2668 KB Output is correct
24 Correct 36 ms 4076 KB Output is correct
25 Correct 40 ms 4416 KB Output is correct
26 Correct 16 ms 2292 KB Output is correct
27 Correct 12 ms 1716 KB Output is correct
28 Correct 9 ms 1232 KB Output is correct
29 Correct 39 ms 4676 KB Output is correct
30 Correct 45 ms 4664 KB Output is correct
31 Correct 37 ms 4676 KB Output is correct
32 Correct 39 ms 4404 KB Output is correct
33 Correct 23 ms 2180 KB Output is correct
34 Correct 9 ms 1188 KB Output is correct
35 Correct 1 ms 216 KB Output is correct
36 Correct 1 ms 216 KB Output is correct
37 Correct 1 ms 216 KB Output is correct
# 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 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -