198742025-12-28 12:47:19madvirMegrendelésekcpp17Wrong answer 0/504ms548 KiB
#include <iostream>
#include <algorithm>

using namespace std;

struct rendeles {
    int sor, hat;
};

bool rule(rendeles x, rendeles y) {
    return x.hat<y.hat;
}

int main() {
    int n, m, k;
    cin >> n >> m >> k;
    rendeles a[10001];
    for(int i=1; i<=m; i++) {
        cin >> a[i].hat;
        a[i].sor=i;
    }
    sort(a+1, a+m+1, rule);
    
    ///until here its the exact same, except for the fact that shes using a vector.
    //she is using a struct too, with the same values: ind=sor, ido=hat
    //r is a for her, jo is b. imma change this too, to make things easier for myself

    rendeles b[10001];

    //lets change this while to check each day

    int t=0, nc=1, lim=0, veg=0, ag=1, bg=1;
    while(nc<=n) {
        while(a[ag].hat>=nc && lim<k && ag<=m) {
            b[bg].sor=a[ag].sor;
            b[bg].hat=nc;
            bg++;
            ag++;
            lim++;
        }
        nc++;
    }
    cout << bg-1 << endl;
    for(int i=1; i<bg; i++) {
        cout << b[i].sor << " " << b[i].hat;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer1ms340 KiB
2Wrong answer4ms508 KiB
subtask20/5
3Wrong answer1ms512 KiB
4Wrong answer1ms316 KiB
5Wrong answer1ms316 KiB
6Wrong answer1ms316 KiB
7Wrong answer1ms316 KiB
subtask30/5
8Wrong answer1ms316 KiB
9Wrong answer1ms316 KiB
10Wrong answer1ms544 KiB
11Wrong answer1ms404 KiB
12Wrong answer1ms316 KiB
subtask40/5
13Wrong answer1ms316 KiB
14Wrong answer3ms316 KiB
15Wrong answer2ms316 KiB
16Wrong answer2ms316 KiB
17Wrong answer1ms316 KiB
subtask50/10
18Wrong answer1ms316 KiB
19Wrong answer1ms508 KiB
20Wrong answer1ms316 KiB
21Wrong answer1ms508 KiB
22Wrong answer1ms316 KiB
23Wrong answer2ms316 KiB
24Wrong answer1ms508 KiB
25Wrong answer4ms548 KiB
26Wrong answer4ms472 KiB
27Wrong answer4ms424 KiB
subtask60/25
28Wrong answer1ms316 KiB
29Wrong answer1ms316 KiB
30Wrong answer1ms508 KiB
31Wrong answer4ms348 KiB
32Wrong answer4ms316 KiB
33Wrong answer3ms316 KiB
34Wrong answer4ms316 KiB
35Wrong answer4ms500 KiB
36Wrong answer4ms316 KiB
37Wrong answer4ms508 KiB
38Wrong answer3ms316 KiB
39Wrong answer1ms316 KiB
40Wrong answer2ms316 KiB
41Wrong answer4ms316 KiB
42Wrong answer1ms316 KiB
43Wrong answer3ms444 KiB
44Wrong answer4ms316 KiB
45Wrong answer1ms316 KiB
46Wrong answer3ms316 KiB
47Wrong answer4ms316 KiB
48Wrong answer4ms316 KiB
49Wrong answer4ms316 KiB
50Wrong answer4ms316 KiB
51Wrong answer4ms316 KiB
52Wrong answer4ms316 KiB