Submission #75814702
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define MOD 1000000007
#define INF 987654321
#define PI 3.1415926535
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
int n, k;
ll m;
cin >> n >> k >> m;
vector<int> a(n);
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
if (m <= (ll)n)
{
cout << a[m - 1];
return 0;
}
sort(a.begin(), a.end());
cout << a[k - 1];
}
Submission Info
| Submission Time | |
|---|---|
| Task | F - The Kth Smallest Number |
| User | Nyso |
| Language | C++23 (GCC 15.2.0) |
| Score | 100 |
| Code Size | 534 Byte |
| Status | AC |
| Exec Time | 38 ms |
| Memory | 4568 KiB |
Judge Result
| Set Name | Sample | All | ||
|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||
| Status | AC |
|
| Set Name | Test Cases |
|---|---|
| Sample | |
| All | 01-001.txt, 01-002.txt, 01-003.txt, 01-004.txt, 01-005.txt, 01-006.txt, 01-007.txt, 01-008.txt, 01-009.txt, 01-010.txt, 01-011.txt, 01-012.txt, 01-013.txt, 01-014.txt, 01-015.txt, 01-016.txt, 01-017.txt, 01-018.txt, 01-019.txt, 01-020.txt, 01-021.txt, 01-022.txt, 01-023.txt, 01-024.txt, 01-025.txt, 01-026.txt, 01-027.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01-001.txt | AC | 2 ms | 3404 KiB |
| 01-002.txt | AC | 1 ms | 3460 KiB |
| 01-003.txt | AC | 1 ms | 3416 KiB |
| 01-004.txt | AC | 1 ms | 3516 KiB |
| 01-005.txt | AC | 1 ms | 3436 KiB |
| 01-006.txt | AC | 1 ms | 3436 KiB |
| 01-007.txt | AC | 1 ms | 3300 KiB |
| 01-008.txt | AC | 1 ms | 3436 KiB |
| 01-009.txt | AC | 1 ms | 3464 KiB |
| 01-010.txt | AC | 1 ms | 3460 KiB |
| 01-011.txt | AC | 1 ms | 3492 KiB |
| 01-012.txt | AC | 1 ms | 3460 KiB |
| 01-013.txt | AC | 17 ms | 4460 KiB |
| 01-014.txt | AC | 17 ms | 4456 KiB |
| 01-015.txt | AC | 37 ms | 4556 KiB |
| 01-016.txt | AC | 37 ms | 4568 KiB |
| 01-017.txt | AC | 22 ms | 3944 KiB |
| 01-018.txt | AC | 20 ms | 3928 KiB |
| 01-019.txt | AC | 34 ms | 4404 KiB |
| 01-020.txt | AC | 38 ms | 4556 KiB |
| 01-021.txt | AC | 17 ms | 4556 KiB |
| 01-022.txt | AC | 16 ms | 4568 KiB |
| 01-023.txt | AC | 14 ms | 4556 KiB |
| 01-024.txt | AC | 32 ms | 4468 KiB |
| 01-025.txt | AC | 10 ms | 4416 KiB |
| 01-026.txt | AC | 17 ms | 4456 KiB |
| 01-027.txt | AC | 13 ms | 4428 KiB |