Codeforces Round #281 (Div. 2) A
来源:互联网 发布:进度网络计划图 编辑:程序博客网 时间:2024/06/06 13:18
A题就是一个水模拟,看懂题目就可以了
By xiaotaiyangAC, contest: Codeforces Round #281 (Div. 2), problem: (A) Vasya and Football, Accepted, # #include#include#include#include#include#include#include#include#include#define N 100using namespace std;struct F{ char s[30]; char ch; int time; int num; int v;};F f[N];bool cmp(F x,F y){ return x.time>sh>>sa; //cout<<sa<<endl<<sh<>n; int t1,t2,k=0; char ch1,ch2; F t; memset(visA,0,sizeof(visA)); memset(visH,0,sizeof(visH)); while(n--){ cin>>t1>>ch1>>t2>>ch2; //cout<<t1<<endl<<ch1<<endl<<t2<<endl<<ch2<<endl; if(ch1=='h'&&!visH[t2]){ visH[t2]=1; strcpy(f[k].s,sh); f[k].num=t2; f[k].time=t1; f[k].ch='h'; if(ch2=='y') f[k].v=1; else f[k].v=2; k++; } else if(ch1=='a'&&!visA[t2]){ visA[t2]=1; strcpy(f[k].s,sa); f[k].num=t2; f[k].time=t1; f[k].ch='a'; if(ch2=='y') f[k].v=1; else f[k].v=2; k++; } else{ //cout<<"he"<<endl; for(int j=0;j<k;j++){ if(f[j].num==t2&&f[j].ch==ch1){ if(f[j].v==1){ f[j].time=t1; f[j].v=2; //cout<<"he"<<endl; } break; } } } //printf("%s %c %d %d %d\n",f[k-1].s,f[k-1].ch,f[k-1].time,f[k-1].num,f[k-1].v); } sort(f,f+k,cmp); for(int i=0;i<k;i++){ if(f[i].v==2) printf("%s %d %d\n",f[i].s,f[i].num,f[i].time); } return 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题
- 美版t430笔记本win8系统下装Ubuntu的一些尝试和遇到的问题
- Android Bootloader LittleKernel的两篇文章
- 如何让 height:100%; 起作用
- nginx简单负载均衡设置
- mysql中limit的用法深入分析
- Codeforces Round #281 (Div. 2) A
- leetcode -- Container With Most Water
- eclipse svn IP 更改
- ZigZag Conversion
- HDU5112
- android平台下使用点九PNG技术
- windows 如何查看端口占用情况?
- Mac下 安装rockmong 自己搞了半天。终于借助两个帖子搞定了。
- 使用 /sys 文件系统访问 Linux 内核