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 ...
随机推荐
- java源码之LinkedHashMap
先盗两张图感受一下(来自:https://blog.csdn.net/justloveyou_/article/details/71713781) HashMap和双向链表的密切配合和分工合作造就了L ...
- Ruby中写换行
Ruby中写换行 print("Hello,\nRuby\n!\n") print("Hello, Ruby ! ") 这两个竟然是一样的:就是说,可以直接回车 ...
- Maven传递依赖的时候,同名包不同版本号的包均会下载,可是编译的时候,仅仅会载入一个高版本号的。
描写叙述,在一个Maven项目中.同一时候依赖了spring-tomcat-weaver 和 struts-core 包.可是spring-tomcat-weaver 须要commons-dige ...
- Default Document <defaultDocument> IIS中的默认页面
https://docs.microsoft.com/en-us/iis/configuration/system.webserver/defaultdocument/index Default do ...
- php和js区别
php和js区别 两者在语法上类似,楼上说的对,js=javascript是工作在浏览器端的脚本语言,他所提交的数据是交给浏览器来处理的.但是现在的Ajax技术已经可以把js提交的数据交付到浏览器来处 ...
- SVG 贝塞尔曲线控制【方便设置】:贝塞尔曲线
http://dayu.pw/svgcontrol/
- Linux Yum 命令使用举例
转自:https://blog.csdn.net/u012359618/article/details/51199309/ 本文给大家讲解Yum的使用15个范例: Yum软件包管理方式,在Red Ha ...
- P2742 [USACO5.1]圈奶牛Fencing the Cows
题目描述 农夫约翰想要建造一个围栏用来围住他的奶牛,可是他资金匮乏.他建造的围栏必须包括他的奶牛喜欢吃草的所有地点.对于给出的这些地点的坐标,计算最短的能够围住这些点的围栏的长度. 输入输出格式 输入 ...
- 51nod 1435 位数阶乘 (手动计算)
题目: 1435 位数阶乘 题目来源: CodeForces 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 X是一个n位数的正整数 (x=a0a1...an−1) ...
- Reactive programming-文章解析
数据源(信息源):静态的数组.动态的流: In computing, reactive programming is a declarative programming paradigm concer ...