Nordic Collegiate Programming Contest 2017 题解

Nordic Collegiate Programming Contest 2019 部分题解 目录[Nordic Collegiate Programming Contest 2019] 部分题解(FGIK)[Flow Finder]题意分析“界面”重新分析结论 Nordic Collegiate Programming Contest 2019 部分题解(FGIK) 前言,做国外的比赛感觉好像难度上比国内同时期的比赛要简单一点,但是在这种情况下出线的国内的队伍却不能轻松wf捧杯,感觉有点... 阅读详情

前几天打了一场外国人的比赛,感觉那边的题目质量还是很好的,区分度很鲜明,题目没有国内的难,坑点比较少,比较注重思维,基础算法。


B题:

Best Relay Team

/problems/bestrelayteam/file/statement/en/img-0001.jpg
Picture by Fernando Frazão/Agência Brasil, cc by
You are the coach of the national athletics team and need to select which sprinters should represent your country in the  4×100 4×100 m relay in the upcoming championships.

As the name of the event implies, such a sprint relay consist of  4 4legs,  100 100 meters each. One would think that the best team would simply consist of the  4 4 fastest  100 100 m runners in the nation, but there is an important detail to take into account: flying start. In the  2 2nd,  3 3rd and  4 4th leg, the runner is already running when the baton is handed over. This means that some runners – those that have a slow acceleration phase – can perform relatively better in a relay if they are on the  2 2nd,  3 3rd or  4 4th leg.

You have a pool of runners to choose from. Given how fast each runner in the pool is, decide which four runners should represent your national team and which leg they should run. You are given two times for each runner – the time the runner would run the  1 1st leg, and the time the runner would run any of the other legs. A runner in a team can only run one leg.

Input

The first line of input contains an integer  n n, the number of runners to choose from ( 4≤n≤500 4≤n≤500). Then follow  n n lines describing the runners. The  i i’th of these lines contains the name of the  i i’th runner, the time  ai ai for the runner to run the  1 1st leg, and the time  bi bi for the runner to run any of the other legs ( 8≤bi≤ai<20 8≤bi≤ai<20). The names consist of between  2 2 and  20 20 (inclusive) uppercase letters ‘A’-‘Z’, and no two runners have the same name. The times are given in seconds with exactly two digits after the decimal point.

Output

First, output a line containing the time of the best team, accurate to an absolute or relative error of at most  10−9 10−9. Then output four lines containing the names of the runners in that team. The first of these lines should contain the runner you have picked for the  1 1st leg, the second line the runner you have picked for the  2 2nd leg, and so on. Any solution that results in the fastest team is acceptable.

Sample Input 1 Sample Output 1
6
ASHMEADE 9.90 8.85
BLAKE 9.69 8.72
BOLT 9.58 8.43
CARTER 9.78 8.93
FRATER 9.88 8.92
POWELL 9.72 8.61
35.54
CARTER
BOLT
POWELL
BLAKE
Sample Input 2 Sample Output 2
9
AUSTRIN 15.60 14.92
DRANGE 15.14 14.19
DREGI 15.00 14.99
LAAKSONEN 16.39 14.97
LUNDSTROM 15.83 15.35
MARDELL 13.36 13.20
POLACEK 13.05 12.55
SANNEMO 15.23 14.74
SODERMAN 13.99 12.57
52.670000
MARDELL
POLACEK
SODERMAN
DRANGE
这个题是签到题,比较简单,枚举第一个人,后面三个人取最快的三个人就行

#include <bits/stdc++.h>
using namespace std;
const int maxn = 500 + 10;
int n;
double eps = 0.0000000001;
struct node{
    string name;
    double speed1, speed2;
    bool operator <(const node &res) const{
        return speed2 < res.speed2;
    }
}Node[maxn];
vector<node> g;
int main()
{
    scanf("%d", &n);
    for(int i = 1; i <= n; i++)
    {
        cin>>Node[i].name>>Node[i].speed1>>Node[i].speed2;
    }
    double Min = 1000000000000.0;
    string s1, s2, s3, s4;
    for(int i = 1; i <= n; i++)
    {
        g.clear();
        double sum = Node[i].speed1;
        for(int j = 1; j <= n; j++)
        {
            if(j != i) g.push_back(Node[j]);
        }
        sort(g.begin(), g.end());
        for(int j = 0; j <= 2; j++)
        {
            sum += g[j].speed2;
        }
        if(sum - Min < eps)
        {
            Min = sum;
            s1 = Node[i].name;
            s2 = g[0].name;
            s3 = g[1].name;
            s4 = g[2].name;
        }

    }
    printf("%.2lf\n", Min);
    cout<<s1<<endl<<s2<<endl<<s3<<endl<<s4<<endl;
    return 0;
}

D题:

Distinctive Character

/problems/distinctivecharacter/file/statement/en/img-0001.jpg
Picture by Fairytalemaker on Pixabay
Tira would like to join a multiplayer game with  n n other players. Each player has a character with some features. There are a total of  k k features, and each character has some subset of them.

The similarity between two characters  A A and  B B is calculated as follows: for each feature  f f, if both  A A and  B B have feature 

Nordic Collegiate Programming Contest 2007 立即下载

相关推荐

实战测评:4大搜索API(You.com/Tavily/Exa/Perplexity)谁更适合你的AI项目?附Python调用代码

本文实战测评了You.com、Tavily、Exa和Perplexity四大搜索API在AI项目中的集成应用,详细对比了它们的技术特性和Python调用方法。针对LLM实时数据需求,You.com的优化设计表现突出,支持32k大上下文窗口和快速响应。文章提供了完整的代码示例和场景化选型建议,帮助开发者高效集成搜索API到AI项目中。

weixin_42569329的博客 491

【数字图像相关-OpenCorr学习笔记】Epipolar search原理+代码解析

OpenCorr是一个开源C++库,用于研究和开发数字图像相关(DIC)技术它提供了2D和立体声DIC的全功能模块,以及数字体积相关(DVC)。最近正在学习OpenCorr,为了更深层次地理解ICGN,我打算浅浅剖析Opencorr的代码,学习的过程中写下这篇学习笔记,以后忘记了还能回来看看。同时,作为一名在读研究生,希望能得到社区大佬的指点,以及跟同学们一起学习进步。这一期主要讲解Eipipolar search的原理,并且附上部分代码解析。

ywyywyy的博客 1366

白炽灯寿命工程解析:从钨丝蒸发到电压控制的可靠性设计

白炽灯作为一种经典的电光源,其工作原理基于电流通过钨丝产生热辐射发光。在高温下,钨丝会持续蒸发导致灯丝逐渐变细、电阻增大,这是影响其寿命的核心物理机制。从工程角度看,白炽灯的可靠性设计涉及材料科学、热力学和电路设计的交叉,技术价值在于通过理解其失效原理,可以在成本与性能间取得最佳平衡。在实际应用中,电压波动、开关浪涌电流和机械振动是主要寿命杀手,尤其在工业控制、仪器仪表和特定照明场景中,合理的设计能大幅提升系统稳定性。本文深入探讨了钨蒸发、热应力等关键因素,并结合浪涌抑制和降压设计等实战技巧,为工程师提供了

weixin_28684655的博客 575

ESP32-C61 eFuse控制器深度解析:寄存器架构与安全烧写实践

eFuse(电子熔丝)是嵌入式芯片实现硬件级不可逆配置与信任根构建的核心物理机制,其本质是通过电学编程固化关键安全参数。原理上依赖熔丝单元的单向导通/断开特性,结合Reed-Solomon纠错、多级写保护和时序可控编程,保障数据在宽温域与工艺偏差下的高可靠性。技术价值在于为Secure Boot、Flash加密、密钥隔离等安全功能提供可信锚点,支撑从启动到运行的全链路防护。典型应用场景涵盖物联网设备量产烧录、安全启动使能、MAC地址固化及抗DPA密码运算配置。本文聚焦ESP32-C61平台,深入解析其eFu

weixin_42589700的博客 125

HMMER实战:从零部署到序列分析

本文详细介绍了HMMER工具的安装与使用,从源码编译到环境配置,再到核心工具hmmbuild、hmmsearch等的实战应用。通过球蛋白序列分析案例,展示了HMMER在生物信息学中的强大功能,帮助读者快速掌握序列分析技巧。

weixin_42529366的博客 263

【实战学习(五)】开源项目学习之uWSGI的部署以及配合nginx

文章目录1)uWSGI是什么?1.1 WSGI1.1.1 Application端1.1.2 Server端1.1.3 WSGI中间件1.2 uwgi1.3 uWSGI、WSGI、uwsgi之间的关系*为什么有了uWSGI为什么还需要nginx?2)连接uwsgi和Django*避坑之Windows10安装uWSGI非常极其艰难,最好勿浪费时间,直接转战Linux吧:2.1 uWGI部署2.1.1 在虚拟环境下安装uwsgi:2.1.2 测试uWSGI的运行2.1.3 使用uWSGI运行Django项目2.

黑黑白白君的博客 1515

微信服务号配置总是提示“参数错误”?我就是这样一步步查出问题的

前两天,我遇到了一个很诡异的问题:在微信服务号后台配置服务器地址时,总是提示“参数错误,请重新填写”。

代码简单说 Vue、JAVA、PHP、Node.js 熟练运用,接口、架构、性能全搞定。 1288

使用pyqt5实现可勾选的测试用例界面

使用pyqt5实现可勾选的测试用例界面

天赐好车的博客 632

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

上一篇: POJ1195(树状数组)
下一篇: HDU2476(区间dp)
creatorx
博客等级 码龄10年 127粉丝 145原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值