-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabc047b.cpp
More file actions
57 lines (56 loc) · 1.27 KB
/
abc047b.cpp
File metadata and controls
57 lines (56 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
int H,W,N;
cin >> H >> W >> N;
vector<vector<int>> squrare(H,vector<int>(W));
rep(i,N){
int x,y,a;
cin >> x >> y >> a;
if(a==1){
rep(j,H){
rep(k,W){
if(j < x){
squrare.at(j).at(k)++;
}
}
}
}
if(a==2){
rep(j,H){
rep(k,W){
if(j >= x){
squrare.at(j).at(k)++;
}
}
}
}
if(a==3){
rep(j,H){
rep(k,W){
if(k < y){
squrare.at(j).at(k)++;
}
}
}
}
if(a==4){
rep(j,H){
rep(k,W){
if(k >= y){
squrare.at(j).at(k)++;
}
}
}
}
}
int count=0;
rep(i,H){
rep(j,W){
if (squrare.at(i).at(j) == 0)count++;
}
}
cout << count << endl;
return 0;
}