86002024-01-23 07:17:05BenedekMartonKombináció (50)cpp17Wrong answer 18/503ms4036 KiB
#include <iostream>

using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    int a[m];
    for(int i=0; i<m; i++)
    {
        cin >> a[i];
    }
    if(a[0]==n-m+1)
    {
        a[0]=max(n-m, 1);
        for(int i=0; i<m; i++)
        {
            cout << a[i] << " ";
        }
        cout << endl;
        for(int i=1; i<=m; i++)
        {
            cout << i << " ";
        }
    }
    else if(a[m-1]==m)
    {
        for(int i=n-m+1; i<=n; i++)
        {
            cout << i << " ";
        }
        cout << endl;
        a[m-1]=min(m+1, n);
        for(int i=0; i<m; i++)
        {
            cout << a[i] << " ";
        }
    }
    /*else
    {
    }*/
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base18/50
1Wrong answer0/03ms1868 KiB
2Wrong answer0/03ms2124 KiB
3Accepted2/23ms2288 KiB
4Wrong answer0/23ms2532 KiB
5Accepted2/23ms2752 KiB
6Accepted2/23ms2832 KiB
7Wrong answer0/23ms2984 KiB
8Accepted2/23ms3152 KiB
9Accepted2/23ms3304 KiB
10Accepted4/43ms3416 KiB
11Wrong answer0/43ms3540 KiB
12Wrong answer0/43ms3792 KiB
13Wrong answer0/43ms3804 KiB
14Accepted4/43ms3816 KiB
15Wrong answer0/43ms3948 KiB
16Wrong answer0/62ms4028 KiB
17Wrong answer0/63ms4036 KiB