标签:des style http color os io java ar strong
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
#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;
int N,M,K;
int p;
int guanxi1[1200][1200],guanxi2[1200];
int main()
{
while(scanf("%d%d%d",&N,&M,&K)!=EOF)
{
if(N==0&&M==0&&K==0) break;
scanf("%d",&p);
memset(guanxi1,0,sizeof(guanxi1));
for(int i=1;i<=M;i++)
guanxi2[i]=K;
while(p--)
{
int u,v;
char obj1[20],obj2[20];
scanf("%s %d %s %d",obj1,&u,obj2,&v);
if(obj1[0]=='p'&&obj2[0]=='s')
guanxi2[u]--;
else
{
guanxi1[u][v]=1;
}
}
int ans=0;
for(int i=1;i<=N;i++)
{
for(int j=1;j<=M;j++)
{
if(guanxi1[i][j]) continue;
ans+=guanxi2[j];
}
}
printf("%d\n",ans);
}
return 0;
}
标签:des style http color os io java ar strong
原文地址:http://blog.csdn.net/ck_boss/article/details/39161287