Submission #75814960
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
// https://github.com/skrewbar/cp-templates
#define all(v) (v).begin(), (v).end()
#define compress(v) \
sort(all(v)); \
v.erase(unique(all(v)), (v).end())
#define by(x) [](const auto& a, const auto& b) { return a.x < b.x; }
#define by_desc(x) [](const auto& a, const auto& b) { return a.x > b.x; }
template <typename T>
using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
bool minimize(T& target, T candidate) {
return target > candidate ? (target = candidate, true) : false;
}
template <typename T>
bool maximize(T& target, T candidate) {
return target < candidate ? (target = candidate, true) : false;
}
using ll = long long;
ll a[303030];
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll N, K, M;
cin >> N >> K >> M;
for (int i = 1; i <= N; i++)
cin >> a[i];
if (M <= N) {
cout << a[M];
return 0;
}
sort(a + 1, a + N + 1);
cout << a[K];
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | F - The Kth Smallest Number |
| User | skuru |
| Language | C++23 (GCC 15.2.0) |
| Score | 100 |
| Code Size | 1078 Byte |
| Status | AC |
| Exec Time | 38 ms |
| Memory | 5972 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 | 3504 KiB |
| 01-002.txt | AC | 1 ms | 3576 KiB |
| 01-003.txt | AC | 1 ms | 3528 KiB |
| 01-004.txt | AC | 1 ms | 3404 KiB |
| 01-005.txt | AC | 1 ms | 3524 KiB |
| 01-006.txt | AC | 1 ms | 3448 KiB |
| 01-007.txt | AC | 1 ms | 3404 KiB |
| 01-008.txt | AC | 1 ms | 3576 KiB |
| 01-009.txt | AC | 1 ms | 3376 KiB |
| 01-010.txt | AC | 1 ms | 3488 KiB |
| 01-011.txt | AC | 1 ms | 3404 KiB |
| 01-012.txt | AC | 1 ms | 3416 KiB |
| 01-013.txt | AC | 18 ms | 5808 KiB |
| 01-014.txt | AC | 18 ms | 5848 KiB |
| 01-015.txt | AC | 38 ms | 5844 KiB |
| 01-016.txt | AC | 38 ms | 5972 KiB |
| 01-017.txt | AC | 23 ms | 4764 KiB |
| 01-018.txt | AC | 21 ms | 4808 KiB |
| 01-019.txt | AC | 36 ms | 5680 KiB |
| 01-020.txt | AC | 38 ms | 5964 KiB |
| 01-021.txt | AC | 20 ms | 5968 KiB |
| 01-022.txt | AC | 18 ms | 5808 KiB |
| 01-023.txt | AC | 15 ms | 5836 KiB |
| 01-024.txt | AC | 34 ms | 5968 KiB |
| 01-025.txt | AC | 12 ms | 5792 KiB |
| 01-026.txt | AC | 18 ms | 5836 KiB |
| 01-027.txt | AC | 14 ms | 5808 KiB |