AlgorithmOJ
Problem
Local Problems
All Problems
Problem Category
Status
Contest
Standard Contests
Replay Contests
Virtual Contests
Ranklist
More...
News
About
F.A.Q
Recent Contests
Coming Soon...
Login
Register
2026-11-20 23:14:19
第二小整数
Time Limit:
1000ms
Memory Limit:
32768KB
This problem will be judged on
HDU
. Original ID:
2561
64-bit integer IO format:
%I64d
Java class name:
Main
Prev
Submit
Status
Statistics
Next
Font Size:
Description
求n个整数中倒数第二小的数。
每一个整数都独立看成一个数,比如,有三个数分别是1,1,3,那么,第二小的数就是1。
Input
输入包含多组测试数据。
输入的第一行是一个整数C,表示有C测试数据;
每组测试数据的第一行是一个整数n,表示本组测试数据有n个整数(2<=n<=10),接着一行是 n个整数 (每个数均小于100);
Output
请为每组测试数据输出第二小的整数,每组输出占一行。
Sample Input
2 2 1 2 3 1 1 3
Sample Output
2 1
Source
绍兴托普信息技术职业技术学院——第二届电脑文化节程序设计竞赛
Language:
C++
C++11
C++14
C
Java
Pascal
Python2
Python3
C#
Fortran
Perl
Ruby
Ada
SML
Visual C++
Visual C
CLang
CLang++
Theme:
Monokai
Solarized Light
Material
Share Code?
Yes
No
×
Login
Username:
Password:
Cookie:
Never
One Day
One Week
One Month
One Year
×
Register
Username:
Password:
Repeat Password:
Nickname:
School:
Email:
×
News Title
by