Submission #1708024


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

int main() {
    int w, h, n;
    cin >> w >> h >> n;

    bool cood[109][109];
    for (int i = 0; i < 109; i++) {
        for (int j = 0; j < 109; j++) {
            cood[i][j] = false;
        }
    }

    for (int i = 0; i < n; i++) {
        int x, y, a;
        cin >> x >> y >> a;
        
        if (a == 1) {
            for (int j = 0; j < h; j++) {
                for (int k = 0; k < x; k++) {
                    cood[j][k] = true;
                }
            }
        } else if (a == 2) {
            for (int j = 0; j < h; j++) {
                for (int k = x; k < w; k++) {
                    cood[j][k] = true;
                }
            }
        } else if (a == 3) {
            for (int j = 0; j < y; j++) {
                for (int k = 0; k < w; k++) {
                    cood[j][k] = true;
                }
            }
        } else if (a == 4) {
            for (int j = y; j < h; j++) {
                for (int k = 0; k < w; k++) {
                    cood[j][k] = true;
                }
            }
        }
    }

    int cnt = 0;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (!cood[i][j]) cnt++;
        }
    }

    cout << cnt << endl;

    return 0;
}

Submission Info

Submission Time
Task B - Snuke's Coloring 2 (ABC Edit)
User nomi
Language C++14 (GCC 5.4.1)
Score 200
Code Size 1344 Byte
Status AC
Exec Time 2 ms
Memory 256 KB

Judge Result

Set Name sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 13
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 2 ms 256 KB
dir_02.txt AC 2 ms 256 KB
random_01.txt AC 2 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