Submission #75814474
Source Code Expand
#include <bits/stdc++.h>
#pragma warning(disable:4996)
#pragma comment(linker,"/STACK:336777216")
#pragma GCC optimize("03,unroll-loops")
#pragma GCC target("avx,avx2,fma")
using namespace std;
using ll = long long;
using vl = vector<ll>;
using pll = pair<ll,ll>;
ll POW(ll a,ll b,ll rem) {
ll p=1;
a %= rem;
for (;b;b>>=1,a=(a*a)%rem) {
if (b&1)p = (p*a)%rem;
}
return p;
}
tuple<ll,ll,ll> extended_gcd(ll a,ll b) {
if (a==0) return {b,0,1};
auto [g,x,y] = extended_gcd(b%a,a);
return {g,y-(b/a)*x,x};
}
ll modinverse(ll a ,ll m) {
return (get<1>(extended_gcd(a,m))%m+m)%m;
}
void pre() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
void pre2() {
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
}
void presolve() {
}
void solve() {
ll N,K,M;
cin>>N>>K>>M;
vl v(N);
for (auto &i:v)cin>>i;
if (M>N) {
sort(v.begin(),v.end());
cout<<v[K-1];
}else {
cout<<v[M-1];
}
}
int main() {
pre();
presolve();
ll t=1;
//cin>>t;
while (t--) solve();
}
Submission Info
| Submission Time |
|
| Task |
F - The Kth Smallest Number |
| User |
kuming19 |
| Language |
C++23 (GCC 15.2.0) |
| Score |
100 |
| Code Size |
1179 Byte |
| Status |
AC |
| Exec Time |
32 ms |
| Memory |
5668 KiB |
Compile Error
./Main.cpp:2: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
2 | #pragma warning(disable:4996)
./Main.cpp:3: warning: ignoring '#pragma comment ' [-Wunknown-pragmas]
3 | #pragma comment(linker,"/STACK:336777216")
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 |
1 ms |
3464 KiB |
| 01-002.txt |
AC |
1 ms |
3412 KiB |
| 01-003.txt |
AC |
1 ms |
3356 KiB |
| 01-004.txt |
AC |
1 ms |
3564 KiB |
| 01-005.txt |
AC |
1 ms |
3532 KiB |
| 01-006.txt |
AC |
1 ms |
3496 KiB |
| 01-007.txt |
AC |
1 ms |
3496 KiB |
| 01-008.txt |
AC |
1 ms |
3444 KiB |
| 01-009.txt |
AC |
1 ms |
3412 KiB |
| 01-010.txt |
AC |
1 ms |
3420 KiB |
| 01-011.txt |
AC |
1 ms |
3464 KiB |
| 01-012.txt |
AC |
1 ms |
3496 KiB |
| 01-013.txt |
AC |
15 ms |
5560 KiB |
| 01-014.txt |
AC |
14 ms |
5616 KiB |
| 01-015.txt |
AC |
31 ms |
5624 KiB |
| 01-016.txt |
AC |
32 ms |
5624 KiB |
| 01-017.txt |
AC |
19 ms |
4564 KiB |
| 01-018.txt |
AC |
17 ms |
4388 KiB |
| 01-019.txt |
AC |
29 ms |
5520 KiB |
| 01-020.txt |
AC |
31 ms |
5624 KiB |
| 01-021.txt |
AC |
16 ms |
5588 KiB |
| 01-022.txt |
AC |
14 ms |
5632 KiB |
| 01-023.txt |
AC |
12 ms |
5584 KiB |
| 01-024.txt |
AC |
28 ms |
5588 KiB |
| 01-025.txt |
AC |
9 ms |
5668 KiB |
| 01-026.txt |
AC |
14 ms |
5624 KiB |
| 01-027.txt |
AC |
11 ms |
5528 KiB |