208052026-01-09 10:31:59sandorhannaMunkákcpp17Time limit exceeded 0/80689ms1568 KiB
#include <iostream>
#include <bits/stdc++.h>

using namespace std;

struct munka {int sorsz, nap, bev;};
munka v[100000];

int main()
{
    int N,M;
    cin >> N;
    cin >> M;
    for (int i=1; i<=M; i++)
    {
        v[i].sorsz=i;
        cin >> v[i].nap;
        cin >> v[i].bev;
    }

    for (int i=1; i<=M-1; i++)
    {
        for (int j=i+1; j<=M; j++)
        {
            if (v[i].bev < v[j].bev)
                swap (v[i],v[j]);
        }
    }

    int sbev=0, dbmunka=0;
    int sor[M]={0}, sorsz[M],k=0;
    for (int i=1; i<=M; i++)
    {
        if (sor[v[i].nap]==0 && sor [v[i].nap-1]!=2 && sor [v[i].nap+1]!=2)
        {
            sor[v[i].nap]=2;
            dbmunka++;
            sbev+=v[i].bev;
            sorsz[k]=v[i].sorsz;
            k++;
        }
    }
    cout << sbev << " " << dbmunka << endl;

    for (int i=0; i<k; i++)
    {
        cout << sorsz[i] << " ";
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms316 KiB
2Time limit exceeded675ms1332 KiB
subtask20/10
3Accepted1ms316 KiB
4Accepted1ms316 KiB
5Accepted1ms316 KiB
6Wrong answer1ms316 KiB
7Wrong answer1ms316 KiB
subtask30/10
8Wrong answer1ms336 KiB
9Wrong answer1ms316 KiB
10Wrong answer1ms316 KiB
11Wrong answer1ms316 KiB
12Wrong answer1ms316 KiB
subtask40/10
13Accepted1ms316 KiB
14Accepted1ms316 KiB
15Accepted1ms316 KiB
16Wrong answer1ms316 KiB
17Wrong answer1ms316 KiB
18Wrong answer1ms316 KiB
19Wrong answer1ms332 KiB
20Wrong answer1ms316 KiB
21Accepted1ms508 KiB
22Wrong answer1ms316 KiB
subtask50/10
23Wrong answer1ms336 KiB
24Wrong answer1ms316 KiB
25Wrong answer1ms316 KiB
26Wrong answer1ms316 KiB
27Wrong answer1ms316 KiB
28Runtime error1ms316 KiB
29Runtime error1ms316 KiB
30Runtime error1ms316 KiB
31Runtime error1ms316 KiB
32Runtime error1ms500 KiB
subtask60/10
33Accepted1ms316 KiB
34Accepted1ms316 KiB
35Accepted1ms316 KiB
36Wrong answer1ms316 KiB
37Wrong answer1ms316 KiB
38Wrong answer1ms336 KiB
39Wrong answer1ms316 KiB
40Wrong answer1ms316 KiB
41Wrong answer1ms316 KiB
42Wrong answer1ms316 KiB
43Wrong answer1ms316 KiB
44Wrong answer1ms332 KiB
45Wrong answer1ms316 KiB
46Accepted1ms508 KiB
47Wrong answer1ms316 KiB
48Runtime error1ms316 KiB
49Runtime error1ms316 KiB
50Runtime error1ms316 KiB
51Runtime error1ms316 KiB
52Runtime error1ms500 KiB
53Runtime error2ms500 KiB
54Runtime error1ms508 KiB
55Runtime error2ms316 KiB
56Runtime error2ms316 KiB
57Runtime error1ms500 KiB
subtask70/10
58Accepted1ms316 KiB
59Accepted1ms316 KiB
60Accepted1ms316 KiB
61Wrong answer1ms316 KiB
62Wrong answer1ms316 KiB
63Wrong answer1ms336 KiB
64Wrong answer1ms316 KiB
65Wrong answer1ms316 KiB
66Wrong answer1ms316 KiB
67Wrong answer1ms316 KiB
68Wrong answer1ms316 KiB
69Wrong answer1ms332 KiB
70Wrong answer1ms316 KiB
71Accepted1ms508 KiB
72Wrong answer1ms316 KiB
73Runtime error1ms316 KiB
74Runtime error1ms316 KiB
75Runtime error1ms316 KiB
76Runtime error1ms316 KiB
77Runtime error1ms500 KiB
78Runtime error2ms500 KiB
79Runtime error1ms508 KiB
80Runtime error2ms316 KiB
81Runtime error2ms316 KiB
82Runtime error1ms500 KiB
83Time limit exceeded689ms820 KiB
84Time limit exceeded688ms1012 KiB
85Time limit exceeded689ms824 KiB
86Time limit exceeded689ms820 KiB
87Time limit exceeded677ms820 KiB
subtask80/20
88Accepted1ms316 KiB
89Accepted1ms316 KiB
90Accepted1ms316 KiB
91Wrong answer1ms316 KiB
92Wrong answer1ms316 KiB
93Wrong answer1ms336 KiB
94Wrong answer1ms316 KiB
95Wrong answer1ms316 KiB
96Wrong answer1ms316 KiB
97Wrong answer1ms316 KiB
98Wrong answer1ms316 KiB
99Wrong answer1ms332 KiB
100Wrong answer1ms316 KiB
101Accepted1ms508 KiB
102Wrong answer1ms316 KiB
103Runtime error1ms316 KiB
104Runtime error1ms316 KiB
105Runtime error1ms316 KiB
106Runtime error1ms316 KiB
107Runtime error1ms500 KiB
108Runtime error2ms500 KiB
109Runtime error1ms508 KiB
110Runtime error2ms316 KiB
111Runtime error2ms316 KiB
112Runtime error1ms500 KiB
113Time limit exceeded689ms820 KiB
114Time limit exceeded688ms1012 KiB
115Time limit exceeded689ms824 KiB
116Time limit exceeded689ms820 KiB
117Time limit exceeded677ms820 KiB
118Time limit exceeded681ms1568 KiB
119Time limit exceeded683ms1332 KiB
120Time limit exceeded683ms1336 KiB
121Time limit exceeded683ms1332 KiB
122Time limit exceeded685ms1428 KiB
123Time limit exceeded685ms1332 KiB
124Time limit exceeded685ms1476 KiB
125Time limit exceeded685ms1332 KiB
126Time limit exceeded686ms1536 KiB
127Time limit exceeded686ms1536 KiB