码迷,mamicode.com
首页 > 其他好文 > 详细

poj 3425 Customer support 模拟

时间:2015-04-08 13:17:19      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:poj   算法   

模拟水题。

代码:

//poj 3425
//sep9
#include <iostream>
using namespace std;
const int maxN=1000024;
int vis[maxN];

int main()
{
	int n;
	memset(vis,0,sizeof(vis));
	int q,a,x,sum=0,correct_num=0;
	scanf("%d",&n);
	while(n--){
		scanf("%d%d%d",&q,&a,&x);
		if(a==0) sum+=10;
		else{
			sum+=20;
			if(vis[q]==1)
				sum+=10*correct_num;
			else{
				vis[q]=1;
				++correct_num;
			}	
			if(x==1)
				sum+=20;
		} 
	}
	printf("%d",sum);
	return 0;	
} 


poj 3425 Customer support 模拟

标签:poj   算法   

原文地址:http://blog.csdn.net/sepnine/article/details/44938073

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!