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; }
时间: 2024-10-10 05:04:40