nefu 648 大水题
来源:互联网 发布:pdf语音朗读软件 编辑:程序博客网 时间:2024/04/25 08:47
http://acm.nefu.edu.cn/JudgeOnline/problemshow.php?problem_id=648
description
Google is one of the most famous Internet search engines which hosts and develops a number of Internet-based services and products. On its search engine website, an interesting button “I’m feeling lucky” attracts our eyes. This feature could allow the user skip the search result page and goes directly to the first ranked page. Amazing! It saves a lot of time. The question is, when one types some keywords and presses “I’m feeling lucky” button, which web page will appear? Google does a lot and come up with excellent approaches to deal with it. In this simplified problem, let us just consider that Google assigns every web page an integer-valued relevance. The most related page will be chosen. If there is a tie, all the pages with the highest relevance are possible to be chosen. Your task is simple, given 10 web pages and their relevance. Just pick out all the possible candidates which will be served to the user when “I’m feeling lucky”.
input
The input contains multiple test cases. The number of test cases T is in the first line of the input file. For each test case, there are 10 lines, describing the web page and relevance. Each line contains a character string without any blank characters denoting the URL of this web page and an integer Vi denoting the relevance of this web page. The length of the URL is between 1 and 100 inclusively. (1<=Vi<=100)
output
For each test case, output several lines which are the URLs of the web pages which are possible to be chosen. The order of the URLs is the same as the input. Please look at the sample output for further information of output format.
sample_input
2www.youtube.com 1www.google.com 2www.google.com.hk 3www.alibaba.com 10www.taobao.com 5www.bad.com 10www.good.com 7www.fudan.edu.cn 8www.university.edu.cn 9acm.university.edu.cn 10www.youtube.com 1www.google.com 2www.google.com.hk 3www.alibaba.com 11www.taobao.com 5www.bad.com 10www.good.com 7www.fudan.edu.cn 8www.university.edu.cn 9acm.university.edu.cn 10
sample_output
Case #1:www.alibaba.comwww.bad.comacm.university.edu.cnCase #2:www.alibaba.com
#include <string.h>#include <stdio.h>#include <iostream>using namespace std;struct note{ int num; char ch[102];};note a[12];int main(){ int n; int k=1; scanf("%d",&n); while(n--) { int maxx=-11000; for(int i=0;i<10;i++) { scanf("%s%d",a[i].ch,&a[i].num); if(maxx<a[i].num) maxx=a[i].num; } printf("Case #%d:\n",k++); for(int i=0;i<10;i++) if(a[i].num==maxx) printf("%s\n",a[i].ch); } return 0;}
0 0
- nefu 648 大水题
- 大水题!!!
- 大水题
- poj 1656 大水题
- POJ 2328 大水题
- hdu 4247 大水题
- hdu4252 大水题
- hdu 4206 大水题
- 大水题Q2002
- 大水题Q2003
- 大水题Q2006
- 暴力枚举大水题
- poj2707~大水题
- HDOJ1234|大水题
- hdu1018(大水题)
- sgu299:Triangle(大水题)
- poj1154(大水题)
- Liserious战队 大水题
- Cocos2d3.0 制作PList文件
- 深入理解 AngularJS 的 Scope
- 利用WINDOWS的消息机制进行截断视频的循环显示
- ARM体系之MMU
- git 入门
- nefu 648 大水题
- Class streamManipulator(for hw) cout的应用
- 也谈JavaScript模块化开发类库的实现
- socket 阻塞系列1
- hdu-1069-Monkey and Banana
- SQL注入漏洞
- week--10作业第一题,比较繁琐。-_-!
- nyoj 814 又见导弹拦截
- MSServer 设置数据库自增字段