Source Code
#include <bits/stdc++.h>

using namespace std;
int n,m;
int a[100010],b[100001],c[100010];
int main()
{
    cin >> n >> m;
    for (int i=0;i<n;i++) {
        cin >> a[i];
        c[i]=a[i];
    }
    for (int j=0;j<m;j++) {
        cin  >> b[j];
    }
    sort(c,c+n);
    reverse (c,c+n);
    int x = n-m , j=0;
    for (int i=0;i<n;i++) {
        if ( a[i] == c[j] && x > 0) {
            j++;
            x--;
        }
        else {
            cout << i+1 << ' ';
        }
    }
}
Copy
Probability Game MOohamed_Mahfouz
GNU G++11
2 ms
236 KB
Wrong Answer