codeforces#281 A
脑子有点秀逗
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
int teama[]={};
int teamb[]={};
int main()
{
string away,home;
cin>>home>>away;
int n;
cin>>n;
for(int i=;i<n;i++)
{
int nu,time;
string ca,peo;
cin>>time>>peo>>nu>>ca;
if(peo=="h"){
if(ca=="r"&&teama[nu]!=-){
cout<<home<<" "<<nu<<" "<<time<<endl;
teama[nu]=-;
}
if(ca=="y"){
if(teama[nu]==){
cout<<home<<" "<<nu<<" "<<time<<endl;
teama[nu]=-;
}
if(teama[nu]!=-)
teama[nu]++;
}
}
else{
if(ca=="r"&&teamb[nu]!=-){
cout<<away<<" "<<nu<<" "<<time<<endl;
teamb[nu]=-;
}
if(ca=="y"){
if(teamb[nu]==)
{
cout<<away<<" "<<nu<<" "<<time<<endl;
teamb[nu]=-;
}
if(teamb[nu]!=-)
teamb[nu]++;
}
}
}
return ;
}
codeforces#281 A的更多相关文章
- codeforces@281 B
shui #include<iostream> #include<cstdio> #include<cstring> #include<algorithm&g ...
- Codeforces Round #281 (Div. 2)
题目链接:http://codeforces.com/contest/493 A. Vasya and Football Vasya has started watching football gam ...
- Codeforces Round #281 (Div. 2) 解题报告
题目地址:http://codeforces.com/contest/493 A题 写完后就交了,然后WA了,又读了一遍题,没找出错误后就开始搞B题了,后来回头重做的时候才发现,球员被红牌罚下场后还可 ...
- Codeforces Round #281 (Div. 2) D(简单博弈)
题目:http://codeforces.com/problemset/problem/493/D 题意:一个n*n的地图,有两个人在比赛,第一个人是白皇后开始在(1,1)位置,第二个人是黑皇后开始在 ...
- Codeforces Round #281 (Div. 2) B. Vasya and Wrestling 水题
B. Vasya and Wrestling 题目连接: http://codeforces.com/contest/493/problem/B Description Vasya has becom ...
- Codeforces Round #281 (Div. 2) A. Vasya and Football 模拟
A. Vasya and Football 题目连接: http://codeforces.com/contest/493/problem/A Description Vasya has starte ...
- Codeforces Round #281 (Div. 2) D. Vasya and Chess 水
D. Vasya and Chess time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- Codeforces Round #281 (Div. 2) C. Vasya and Basketball 二分
C. Vasya and Basketball time limit per test 2 seconds memory limit per test 256 megabytes input stan ...
- Codeforces Round #281 (Div. 2) D. Vasya and Chess 镜面对称 博弈论
D. Vasya and Chess time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
随机推荐
- 2014百度之星资格赛—— Xor Sum(01字典树)
Xor Sum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others) Total ...
- hadoop系列:zookeeper(2)——zookeeper核心原理(选举)
1.前述 上篇文章<hadoop系列:zookeeper(1)--zookeeper单点和集群安装>(http://blog.csdn.net/yinwenjie/article/deta ...
- C++开发人脸性别识别教程(7)——搭建MFC框架之界面绘制
在之前的博客中我们已经将项目中用到的算法表述完成,包含人脸检測算法以及四种性别识别算法,在这篇博客中我们将着手搭建主要的MFC框架. 一.框架概况 在这篇博文中我们将搭建最主要的MFC框架.绘制MFC ...
- 多本Web前端深度修炼书籍(提供网盘下载链接)
书籍介绍:这本书涵盖了html5新增标签和功能,而且提供了jquerymobile,Phonegap,Sencha Touch框架的介绍和应用,最后还带了一个移动web应用的样例,绝对是移动web开发 ...
- OpenCV基础篇之读取显示图片
程序及分析 /* * FileName : read.cpp * Author : xiahouzuoxin @163.com * Version : v1.0 * Date : Tue 13 May ...
- org.hibernate.AssertionFailure: null id in com.you.model.User entry (don't flush the Session after a
1.错误描写叙述 org.hibernate.AssertionFailure: null id in com.you.model.User entry (don't flush the Sessio ...
- $(window).load(function(){})跟$(document).ready(function(){})跟$(function(){})区别
1.页面DOM加载完成 2.$(document).ready(function(){}) 的简写是 $(function(){}) 执行 3.图片样式等所有HTML元素加载完毕 4.$(windo ...
- xBIM 实战03 使用WPF技术实现IFC模型的加载与浏览
系列目录 [已更新最新开发文章,点击查看详细] WPF应用程序在底层使用 DirectX ,无论设计复杂的3D图形(这是 DirectX 的特长所在)还是绘制简单的按钮与文本,所有绘图工作都是 ...
- hiho 1564 - 简单dfs + 宏的危害!!!
题目链接 H公司有 N 台服务器,编号1~N,组成了一个树形结构.其中中央服务器处于根节点,终端服务器处于叶子节点. 中央服务器会向终端服务器发送消息.一条消息会通过中间节点,到达所有的终端服务器.消 ...
- Ubantu 14.04下安装高版本cmake
Ubantu14.04 下自带的cmake版本比较低(默认为2.8),这里我们从源码编译高版本cmake: 先卸载电脑上安装的cmake (如何已安装的话): sudo apt-get autorem ...