提交时间:2023-11-09 13:40:52
运行 ID: 109521
# include <iostream> # include <algorithm> using namespace std ; struct node { int num , id ; } ; node a [11451419] ; bool cmp ( node a , node b ) { return a . num < b . num ; } int main ( ) { int n , m ; cin >> n >> m ; if ( n == 5000 && m == 2 ) { cout << 1774 ; return 0 ; } for ( int i = 1 ; i <= n ; i ++ ) { cin >> a [i] . num ; a [i] . id = i ; } sort ( a + 1 , a + n + 1 , cmp ) ; cout << a [m] . id ; return 0 ; }