zoukankan      html  css  js  c++  java
  • codeforces#281 A

    脑子有点秀逗

     1 #include<iostream>
     2 #include<cstdio>
     3 #include<cstring>
     4 #include<algorithm>
     5 #include<cmath>
     6 using namespace std;
     7 int teama[120]={0};
     8 int teamb[120]={0};
     9 int main()
    10 {
    11     string away,home;
    12     cin>>home>>away;
    13     int n;
    14     cin>>n;
    15     for(int i=0;i<n;i++)
    16     {
    17         int nu,time;
    18         string ca,peo;
    19         cin>>time>>peo>>nu>>ca;
    20         if(peo=="h"){
    21             if(ca=="r"&&teama[nu]!=-1){
    22                 cout<<home<<" "<<nu<<" "<<time<<endl;
    23                 teama[nu]=-1;
    24             }
    25             if(ca=="y"){
    26                 if(teama[nu]==1){
    27                     cout<<home<<" "<<nu<<" "<<time<<endl;
    28                     teama[nu]=-1;
    29                 }
    30                 if(teama[nu]!=-1)
    31                 teama[nu]++;
    32             }
    33         }
    34         else{
    35             if(ca=="r"&&teamb[nu]!=-1){
    36                 cout<<away<<" "<<nu<<" "<<time<<endl;
    37                 teamb[nu]=-1;
    38             }
    39             if(ca=="y"){
    40                 if(teamb[nu]==1)
    41                 {
    42                     cout<<away<<" "<<nu<<" "<<time<<endl;
    43                     teamb[nu]=-1;
    44                 }
    45                 if(teamb[nu]!=-1)
    46                     teamb[nu]++;
    47             }
    48         }
    49     }
    50     return 0;
    51 }
    View Code
  • 相关阅读:
    jQuery之Ajax应用
    ELK安装配置简单使用
    saltstack其他运行模式
    saltstack syndic安装配置使用
    salt api
    saltstack api安装使用
    saltstack master minion安装配置简单使用
    zabbix api
    zabbix snmp、jmx配置使用
    phoenix安装
  • 原文地址:https://www.cnblogs.com/vactor/p/4142298.html
Copyright © 2011-2022 走看看