Submission #3238833


Source Code Expand

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iomanip>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)

#define DEBUG

#ifdef DEBUG
#define var_dump(...) fprintf(stdout, __VA_ARGS__)
#define dump(a) cout << a << "\n";
#else
#define var_dump(...) 42
#define dump(a) 42
#endif

// https://beta.atcoder.jp/contests/abc047/tasks/abc047_b

int main() {
    int W, H, N;
    cin >> W >> H >> N;

    int xl = 0;
    int xh = W;
    int yl = 0;
    int yh = H;

    int x, y, a;
    REP(i, N) {
        cin >> x >> y >> a;

        if (a == 1) {
            xl = max(xl, x);
        }
        if (a == 2) {
            xh = min(xh, x);
        }
        if (a == 3) {
            yl = max(yl, y);
        }
        if (a == 4) {
            yh = min(yh, y);
        }
    }

    cout << max(0, (xh - xl) * (yh - yl)) << "\n";

    return 0;
}

Submission Info

Submission Time
Task B - Snuke's Coloring 2 (ABC Edit)
User wakamenod
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1280 Byte
Status WA
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name sample All
Score / Max Score 0 / 0 0 / 200
Status
AC × 3
AC × 12
WA × 1
Set Name Test Cases
sample sample_01.txt, sample_02.txt, sample_03.txt
All dir_01.txt, dir_02.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, sample_01.txt, sample_02.txt, sample_03.txt, small_01.txt, small_02.txt, small_03.txt, small_04.txt
Case Name Status Exec Time Memory
dir_01.txt AC 1 ms 256 KB
dir_02.txt AC 1 ms 256 KB
random_01.txt WA 1 ms 256 KB
random_02.txt AC 1 ms 256 KB
random_03.txt AC 1 ms 256 KB
random_04.txt AC 1 ms 256 KB
sample_01.txt AC 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt AC 1 ms 256 KB
small_01.txt AC 1 ms 256 KB
small_02.txt AC 1 ms 256 KB
small_03.txt AC 1 ms 256 KB
small_04.txt AC 1 ms 256 KB