Winner

题目链接:http://codeforces.com/contest/2/problem/A

    ——每天在线,欢迎留言谈论。

题目大意:  

最后结果的最高分 maxscore。在最后分数都为最高分maxscore的玩家中,找那个先得分>=maxscore 的玩家。。。。

o.o...折腾了一天,题意没搞懂。。。

思路:

模拟,没啥思路。此随笔纯粹感慨。。。

AC代码:

 #include <iostream>
#include <map>
#include <string>
using namespace std;
struct record
{
string s;
int score;
record():s(""),score(){}
};
map<string,int> map1,maptemp;
record rec[];
int main()
{
int n,a,maxscore;
string ss;
cin>>n;
for(int i=;i<n;i++)
{
cin>>ss>>a;
map1[ss]+=a;
//cout<<ss<<":"<<map1[ss]<<endl;
rec[i].s=ss;
rec[i].score=a;
}
maxscore=map1[rec[].s];
for(int i=;i<n;i++)
if(map1[rec[i].s]>maxscore)
maxscore=map1[rec[i].s];
for(int i=;i<n;i++)
{
maptemp[rec[i].s]+=rec[i].score;
if(map1[rec[i].s]==maxscore&&maptemp[rec[i].s]>=maxscore)
{cout<<rec[i].s<<endl;return ;}
}
return ;
}

2017-05-10 00:47:32

codeforces 2A Winner (好好学习英语)的更多相关文章

  1. CodeForces 2A Winner

    Winner Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit Statu ...

  2. CodeForces 2A - Winner(模拟)

    题目链接:http://codeforces.com/problemset/problem/2/A A. Winner time limit per test 1 second memory limi ...

  3. [IT新应用]如何用好搜索引擎学习英语

    用谷歌可以学习英语,用必应也可以的. 输入如下地址:global.bing.com,如果是中文界面,就单击顶部右侧“Switch to Bing in English”. 这个界面有很多英文原版的时事 ...

  4. 用for、while、do-while循环输出10句“好好学习,天天向上!”

    #include "stdio.h" void main() { int time; ;time<=;time++) printf("%d.好好学习,天天向上!\n ...

  5. YTU 2552: 好好学习天天向上

    2552: 好好学习天天向上 时间限制: 1 Sec  内存限制: 128 MB 提交: 55  解决: 42 题目描述 在刚过去不久的母亲节中,小红答应妈妈要好好学习天天向上.小红对数学特别不擅长, ...

  6. [好好学习]在VMware中安装Oracle Enterprise Linux (v5.7) - (5/5)

  7. [好好学习]在VMware中安装Oracle Enterprise Linux (v5.7) - (4/5)

  8. [好好学习]在VMware中安装Oracle Enterprise Linux (v5.7) - (3/5)

    进入OEL

  9. [好好学习]在VMware中安装Oracle Enterprise Linux (v5.7) - (2/5)

随机推荐

  1. restTemplate.postForObject上传文件中文乱码(???.xls)

    一.问题描述 项目中, 使用restTemplate上传文件时, 文件名中文乱码, 一串问号, 源文件名为: 测试中文乱码哦哦哦.zip, 通过restTemplate.postForObject调用 ...

  2. idea启动多个tomcat失败

    Intellij idea中,为在本地调试两个系统之间的调用,配置两个本地tomcat server,设置不同的端口号,如8081和8082,Deploy中加入两个系统各自的Artifact xxx: ...

  3. [转&精]IO_STACK_LOCATION与IRP的一点笔记

    IO_STACK_LOCATION和IRP算是驱动中两个很基础的东西,为了理解这两个东西,找了一点资料. 1. IRP可以看成是Win32窗口程序中的消息(Message),DEVICE_OBJECT ...

  4. SpringMVC学习(一)———— springmvc框架原理分析和简单入门程序

    一.什么是springmvc? 我们知道三层架构的思想,并且如果你知道ssh的话,就会更加透彻的理解这个思想,struts2在web层,spring在中间控制,hibernate在dao层与数据库打交 ...

  5. 应用负载均衡之LVS(三):ipvsadm命令

    */ .hljs { display: block; overflow-x: auto; padding: 0.5em; color: #333; background: #f8f8f8; } .hl ...

  6. Jenkins+Git+Gitlab+Ansible实现持续集成自动化部署动态网站(二)--技术流ken

    项目前言 在上一篇博客<Jenkins+Git+Gitlab+Ansible实现持续化集成一键部署静态网站(一)--技术流ken>中已经详细讲解了如何使用这四个工具来持续集成自动化部署一个 ...

  7. .NET CORE 实践(3)--Visual Studio 2015 Update 3更新之后DotNetCore.1.0.1-VS2015Tools.Preview2.0.2.exe无法正确安装

    打开 https://www.microsoft.com/net/core#windows,点击 https://go.microsoft.com/fwlink/?LinkId=691129下载vs2 ...

  8. 推荐写作平台gitbook——让我们换一种形式写作

    https://www.gitbook.com/ 我一直用这个平台进行写作.目前有两本电子书可以供大家阅读,分别如下 Office 365 开发入门指南 https://www.gitbook.com ...

  9. C#自动关闭弹出提示框

    自动关闭弹出提示框(用一个小窗体显示提示信息):例如在一个form窗体中弹出自动关闭的提示框1.首先创建一个弹出提示信息的窗体 AutoCloseMassageBox,在里面拖一个lable控件,去掉 ...

  10. Java基础IO流(二)字节流小案例

    JAVA基础IO流(一)https://www.cnblogs.com/deepSleeping/p/9693601.html ①读取指定文件内容,按照16进制输出到控制台 其中,Integer.to ...