标签:style blog http color os io java ar for
2 2 2 0 2 2 2 1 clothes 1 pants 1 2 2 2 2 clothes 1 pants 1 pants 1 shoes 1 0 0 0
8 6 5
1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <cmath> 5 #include <algorithm> 6 #include <climits> 7 #include <vector> 8 #include <queue> 9 #include <cstdlib> 10 #include <string> 11 #include <set> 12 #include <stack> 13 #define LL long long 14 #define pii pair<int,int> 15 #define INF 0x3f3f3f3f 16 using namespace std; 17 const int maxn = 1010; 18 bool a[maxn][maxn],b[maxn][maxn]; 19 int c[maxn]; 20 int main() { 21 int n,m,k,t,u,v,ans; 22 char sa[10],sb[10]; 23 while(scanf("%d %d %d",&n,&m,&k),n||m||k){ 24 memset(a,false,sizeof(a)); 25 memset(b,false,sizeof(b)); 26 memset(c,0,sizeof(c)); 27 scanf("%d",&t); 28 for(int i = ans = 0; i < t; i++){ 29 scanf("%s %d %s %d",sa,&u,sb,&v); 30 if(sa[0] == ‘c‘) a[u][v] = true; 31 else{b[u][v] = true;c[u]++;} 32 } 33 for(int i = 1; i <= n; i++){ 34 for(int j = 1; j <= m; j++) 35 if(!a[i][j]) ans += k-c[j]; 36 } 37 printf("%d\n",ans); 38 } 39 return 0; 40 }
标签:style blog http color os io java ar for
原文地址:http://www.cnblogs.com/crackpotisback/p/3963213.html