codeforces Second-Price Auction
来源:互联网 发布:软件开发人员外派 编辑:程序博客网 时间:2024/05/16 11:34
题目链接:http://codeforces.com/problemset/problem/386/A
题目意思:简单,就是有n个人投标某个东西,有n个数,找出最大的数的下标和第二大数就好了!就是这么简单。
#include<cstdio>#include<algorithm>using namespace std;int A[1001];int main(void){ int n; scanf("%d", &n); int i; int cnt=0,ans=0; for(i=0; i<n; ++i) { scanf("%d", &A[i]); if(A[i]>ans) { ans=A[i]; cnt=i; } } sort(A, A+n); printf("%d %d\n", cnt+1, A[n-2]); return 0;}
0 0
- codeforces Second-Price Auction
- Codeforces 513C Second price auction (bruteforce)
- Second-price Auction
- Second-price Auction
- Codeforces386A. Second-Price Auction
- Second-price Auction
- zoj3202 Second-price Auction
- ZOJ3202-Second-price Auction
- A. Second-price Auction
- Codeforces 513C Second price auction 概率dp 求期望
- codeforces Rockethon 2015 C. Second price auction 概率
- Second price auction - CodeForces 513 C 概率期望
- Codeforces 513C Second price auction 数学公式求期望
- zoj 3202 Second-price Auction
- ZOJ 3202 Second-price Auction
- zoj 3202 Second-price Auction
- ZOJ#3202:Second-price Auction
- ZOJ 3202 Second-price Auction
- 正则表达式学习整理
- 利用对象流模仿登陆注册功能——Java对象流应用
- Rhino使JavaScript应用程序更灵动
- linux修改主机名
- 对于编程:要么热爱,要么离开
- codeforces Second-Price Auction
- 随机模拟的基本思想和常用采样方法(sampling)
- hdu 2686 Matrix 最大费用最大流
- 模版方法模式(Template Method)
- 使用Maven构建Java工程(Building Java Projects with Maven)
- @Override错误
- FOJ 2148(求凸四边形数量)
- 方法中的参数的问题
- 【设计模式基础】行为模式 - 3 - 职责链(Chain of responsibility)