Submission #567010

# Submission time Handle Problem Language Result Execution time Memory
567010 2022-05-23T07:15:03 Z Bill_00 Hexagonal Territory (APIO21_hexagon) C++14
0 / 100
2000 ms 212 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++){
            bound += L[i];
            if(D[i] == 1){
                y += L[i];
            }
            if(D[i] == 2){
                area += (2 * (y - low) * L[i]);
                x += L[i];
            }
            if(D[i] == 3){
                area += ((2 * (y - low) - L[i]) * L[i]);
                x += L[i];
                y -= L[i];
            }
            if(D[i] == 4){
                y -= L[i];
            }
            if(D[i] == 5){
                area -= (2 * (y - low) * L[i]);
                x -= L[i];
            }
            if(D[i] == 6){
                area -= ((2 * (y - low) + L[i]) * L[i]);
                x -= L[i];
                y += L[i];
            }
        }
        area = abs(area);
        if(area != (L[0] * L[0])) while(1);
        ll inter = (area + 2 - bound) / 2;
        return (inter + bound) * (ll)(A);
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 2031 ms 212 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2062 ms 212 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2081 ms 212 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2092 ms 212 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2090 ms 212 KB Time limit exceeded
2 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 -