2014-12-04 13:49:24

总结:水了那么久codeforces,还是没有什么大进步,果然还是不够努力啊。。。

  A、B、C、D都不难,E数学题,没做了。。

A:此题就坑在要判断是否是第一次被出示黄牌。

 1 /*************************************************************************
 2     > File Name: a.cpp
 3     > Author: Nature
 4     > Mail: 564374850@qq.com 
 5     > Created Time: Wed 03 Dec 2014 11:00:13 PM CST
 6 ************************************************************************/
 7 
 8 #include <cstdio>
 9 #include <cstring>
10 #include <cstdlib>
11 #include <cmath>
12 #include <vector>
13 #include <map>
14 #include <set>
15 #include <stack>
16 #include <queue>
17 #include <iostream>
18 #include <algorithm>
19 using namespace std;
20 #define lp (p << 1)
21 #define rp (p << 1|1)
22 #define getmid(l,r) (l + (r - l) / 2)
23 #define MP(a,b) make_pair(a,b)
24 typedef long long ll;
25 const int INF = 1 << 30;
26 
27 int t,n,num;
28 char n1[100],n2[100];
29 int c1[200],c2[200];
30 
31 int main(){
32     char t1[5],t2[5];
33     int a;
34     scanf("%s",n1);
35     scanf("%s",n2);
36     scanf("%d",&n);
37     for(int i = 1; i <= n; ++i){
38         scanf("%d%s%d%s",&t,t1,&num,t2);
39         if(t1[0] == 'h'){
40             if(t2[0] == 'y')
41                 c1[num]++;
42             else
43                 c1[num] += 2;
44             if(c1[num] == 2 || c1[num] == 3){
45                 c1[num] += 10;
46                 printf("%s %d %d\n",n1,num,t);
47             }
48         }
49         else{
50             if(t2[0] == 'y')
51                 c2[num]++;
52             else
53                 c2[num] += 2;
54             if(c2[num] == 2 || c2[num] == 3){
55                 c2[num] += 10;
56                 printf("%s %d %d\n",n2,num,t);
57             }
58         }
59     }
60     return 0;
61 }
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2018-05-16
  • 2021-09-10
猜你喜欢
  • 2021-12-12
  • 2021-06-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案