Submission #1198994
Source Code Expand
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<algorithm>
typedef long long int ll;
using namespace std;
#define EVEL 1
#ifndef EVEL
#define DEB(X) cout << #X << ":" <<X<<" " ;
#define TF(f) f ? cout<<"true " : cout<<"false ";
#define END cout<<"\n";
#else
#define DEB(X) {X;}
#define TF(f) {f;}
#define END {}
#endif
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
#define EREP(i,a) for (int i=1;i<=(a);i++)
const ll MOD = (10*10*10*10*10*10*10*10*10+7);
int A,B,C;
int N,M,K,X,Y,W,H;
int ans;
//string S;
bool S[101][101];
int temp[100]={0};
bool f=true;
bool fir=true;
int main(){
cin>>W>>H>>N;
REP(i,H){
REP(j,W){
S[i][j]=true;
}
}
REP(i,N){
cin>>X>>Y>>A;
if(A==1){
//x<xi
REP(j,H){
REP(k,X){
S[j][k]=false;
}
}
}
else if(A==2){
REP(j,H){
FOR(k,X,W){
S[j][k]=false;
}
}
}
else if(A==3){
REP(j,W){
REP(k,Y){
S[k][j]=false;
}
}
}
else if(A==4){
REP(j,W){
FOR(k,Y,H){
S[k][j]=false;
}
}
}
REP(i,H){REP(j,W){
DEB(S[i][j])
}END}
END
}
REP(i,H)
REP(j,W){
S[i][j]?ans++:ans=ans;
}
cout<<ans;
}
/*A.size()!=0&&B.size()!=0&&C.size()!=0*/
Submission Info
Judge Result
Set Name |
sample |
All |
Score / Max Score |
0 / 0 |
200 / 200 |
Status |
|
|
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 |
2 ms |
256 KB |
random_03.txt |
AC |
2 ms |
256 KB |
random_04.txt |
AC |
2 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 |