250042026-02-17 12:09:51MatematikaMediánok (40 pont)cpp17Wrong answer 3/4016ms1888 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n,k; cin >> n >> k;
    vector<int> vec;
    for(int i=1; i<=n/2; i++)
    {
        vec.push_back(n-i+1);
        vec.push_back(i);
    }
    if(!(n&1))
        vec.pop_back();
    /*for(auto& z:vec)
        cerr << z << " ";*/
    //reverse(vec.begin(), vec.end());
    //vec.push_back((n+1)/2);
    for(int i=0; i<k-1; i++)
    {
        cout << vec[i] << " ";
    }
    cout << k << " ";
    for(int i=k-1; i<n-1; i++)
    {
        cout << vec[i] << " ";
    }
}
SubtaskSumTestVerdictTimeMemory
base3/40
1Accepted0/01ms316 KiB
2Accepted0/013ms1192 KiB
3Wrong answer0/11ms316 KiB
4Accepted1/11ms316 KiB
5Wrong answer0/11ms316 KiB
6Wrong answer0/11ms316 KiB
7Wrong answer0/11ms360 KiB
8Accepted1/11ms316 KiB
9Wrong answer0/11ms316 KiB
10Wrong answer0/12ms316 KiB
11Wrong answer0/11ms316 KiB
12Accepted1/11ms316 KiB
13Wrong answer0/11ms316 KiB
14Wrong answer0/11ms316 KiB
15Wrong answer0/11ms316 KiB
16Wrong answer0/11ms508 KiB
17Wrong answer0/11ms316 KiB
18Wrong answer0/11ms316 KiB
19Wrong answer0/11ms316 KiB
20Wrong answer0/11ms316 KiB
21Wrong answer0/114ms1308 KiB
22Wrong answer0/114ms1404 KiB
23Wrong answer0/114ms1504 KiB
24Wrong answer0/114ms1420 KiB
25Wrong answer0/114ms1568 KiB
26Wrong answer0/116ms1464 KiB
27Wrong answer0/114ms1452 KiB
28Wrong answer0/114ms1452 KiB
29Wrong answer0/114ms1452 KiB
30Wrong answer0/113ms1456 KiB
31Wrong answer0/114ms1888 KiB
32Wrong answer0/114ms1688 KiB
33Wrong answer0/114ms1388 KiB
34Wrong answer0/214ms1648 KiB
35Wrong answer0/114ms1452 KiB
36Wrong answer0/114ms1452 KiB
37Wrong answer0/214ms1460 KiB
38Wrong answer0/114ms1452 KiB
39Wrong answer0/114ms1448 KiB
40Wrong answer0/114ms1472 KiB