Codeforces Round #281 (Div. 2) - A
来源:互联网 发布:ai聊天机器人源码 编辑:程序博客网 时间:2024/05/17 04:12
#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>using namespace std;const int maxn = 100;struct node{int y,r;node():y(0),r(0){}};node cnt[2][maxn];int vis[2][maxn];char str[2][maxn];int main(){ gets(str[0]); gets(str[1]); int n; cin>>n; char ff,pai; int id,t; for(int i=1;i<=n;i++){ cin>>t>>ff>>id>>pai; int team = ff=='h' ? 0 : 1; pai =='y' ? cnt[team][id].y++:cnt[team][id].r++; if(cnt[team][id].y==2){ //最重要的判断条件搞错了 cnt[team][id].y=0; cnt[team][id].r++; } if(cnt[team][id].r==1 && !vis[team][id]){ vis[team][id]=1; cout<<str[team]<<" "<<id<<" "<<t<<endl; } } return 0;}
0 0
- Codeforces Round #281 (Div. 2) A B
- Codeforces Round #281 (Div. 2) - A
- Codeforces Round #281 (Div. 2) A
- Codeforces Round #281 (Div. 2) A. Vasya and Football
- Codeforces Round #281 (Div. 2) A - Vasya and Football
- Codeforces Round #281 (Div. 2)A(构造+暴力模拟)
- Codeforces Round #281 (Div. 2) A,B,C,D
- Codeforces Round #131 (Div. 2) A B
- Codeforces Round #174 (Div. 2) Problem A
- Codeforces Round #173 (Div. 2) A.Bit++
- Codeforces Round #181 (Div. 2) A题
- Codeforces Round #184 (Div. 2) A题
- Codeforces Round #185 (Div. 2)--A,B
- Codeforces Round #172 (Div. 2) A题
- Codeforces Round #166 (Div. 2) A题
- Codeforces Round #132 (Div. 2) A题
- Codeforces Round #131 (Div. 2) A题
- Codeforces Round #133 (Div. 2) A题
- 负载平衡问题
- MFC 中查看一个变量的值
- session、application和pagecontext作用域
- Yii中gii在中文路径时的问题
- 仿腾讯手机管家快捷中心功能的实现方案
- Codeforces Round #281 (Div. 2) - A
- Linux 命令行去除重复 uniq
- Android数据存储与IO
- Java NIO--Channel
- 网络视频传输协议--RTP/RTCP/RTSP/SIP/SDP 之间关系
- JS 参数传递到底是值传递还是引用传递?
- Android输入法扩展之外接键盘显示虚拟键盘修改
- Android WebView的几个操作
- 中断控制---工作队列