码迷,mamicode.com
首页 > 其他好文 > 详细

ZOJ 3202: Second-price Auction

时间:2017-07-30 00:58:09      阅读:200      评论:0      收藏:0      [点我收藏+]

标签:tar   price   iostream   gre   ret   ice   date   acm   zoj   

ZOJ 3202: Second-price Auction

///@author Sycamore, ZJNU
///@date 2017-02-09
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
using namespace std;
int main()
{
    int T,N;
    cin >> T;
    while (T--)
    {
        cin >> N;
        vector<int>v(N);
        for (auto &e : v)cin >> e;
        cout << max_element(v.begin(), v.end()) - v.begin()+1 <<  ;
        sort(v.begin(), v.end(), greater<int>());
        cout << v[1] << endl;
    }
    return 0;
}

 

ZOJ 3202: Second-price Auction

标签:tar   price   iostream   gre   ret   ice   date   acm   zoj   

原文地址:http://www.cnblogs.com/zjnu/p/7258020.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!