214852026-01-13 10:32:02KissCsongor777Megrendelésekcpp17Wrong answer 0/5039ms732 KiB
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

struct task
{
    int s,h;
}t[10001];

int mon(task x, task y)
{
    if(x.h<y.h)return 1;
    return 0;
}

int main()
{
    int n,m,k,a=1,b=0,c=0;
    cin>>n>>m>>k;
    task v[10001];


    for(int i=1; i<=m; i++)
    {
      t[i].s=i;
      cin>>t[i].h;
    }

    sort(t+1, t+m+1, mon);

    for(int i=1; i<=m; i++)cout<<t[i].h<<" "<<t[i].s<<endl;

    cout<<endl;

    for(int i=1; i<=m; i++)
    {

            if(b==k)
        {
            b=0;
            a++;
        }

        if(t[i].h>=a)
  {
            b++;
            v[c+1].s=t[i].s;
            v[c+1].h=a;
            c++;
  }

    }

    cout<<c<<endl;
    for(int i=1; i<=c; i++)
    {
        cout<<v[i].s<<" "<<v[i].h<<endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer1ms316 KiB
2Wrong answer32ms564 KiB
subtask20/5
3Wrong answer1ms316 KiB
4Wrong answer2ms316 KiB
5Wrong answer1ms316 KiB
6Wrong answer1ms316 KiB
7Wrong answer1ms316 KiB
subtask30/5
8Wrong answer2ms316 KiB
9Wrong answer2ms508 KiB
10Wrong answer3ms316 KiB
11Wrong answer3ms420 KiB
12Wrong answer4ms316 KiB
subtask40/5
13Wrong answer2ms416 KiB
14Wrong answer27ms524 KiB
15Wrong answer12ms464 KiB
16Wrong answer19ms564 KiB
17Wrong answer6ms508 KiB
subtask50/10
18Wrong answer1ms316 KiB
19Wrong answer1ms316 KiB
20Wrong answer4ms512 KiB
21Wrong answer4ms316 KiB
22Wrong answer3ms316 KiB
23Wrong answer2ms316 KiB
24Wrong answer4ms316 KiB
25Wrong answer20ms524 KiB
26Wrong answer21ms528 KiB
27Wrong answer24ms552 KiB
subtask60/25
28Wrong answer3ms316 KiB
29Wrong answer2ms548 KiB
30Wrong answer4ms316 KiB
31Wrong answer21ms564 KiB
32Wrong answer39ms704 KiB
33Wrong answer19ms564 KiB
34Wrong answer37ms560 KiB
35Wrong answer37ms564 KiB
36Wrong answer39ms732 KiB
37Wrong answer35ms516 KiB
38Wrong answer19ms496 KiB
39Wrong answer4ms508 KiB
40Wrong answer8ms316 KiB
41Wrong answer28ms568 KiB
42Wrong answer4ms316 KiB
43Wrong answer19ms456 KiB
44Wrong answer34ms676 KiB
45Wrong answer8ms512 KiB
46Wrong answer13ms316 KiB
47Wrong answer20ms508 KiB
48Wrong answer37ms564 KiB
49Wrong answer37ms680 KiB
50Wrong answer39ms496 KiB
51Wrong answer39ms568 KiB
52Wrong answer35ms564 KiB