110162024-06-04 19:33:48zsomborKutyák és macskákcpp17Partially correct 77.48/1001.659s632 KiB
#include "KutyakMacskak.h"
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int c, d;

bool r(int a, int b) {
    return ask(d, a, b) == a;
}

vector <int> find_order(int n, int m) {
    c = 1;
    for (int i = 2; i <= m; i++) if (ask(1, c, i) == c) c = i;
    d = 1;
    for (int i = 1; i <= m; i++) {
        if (i == c || ask(d, c, i) == c) continue;
        d++;
        i--;
    }
    vector <int> ans;
    for (int i = 1; i <= m; i++) ans.push_back(i);
    sort(ans.begin(), ans.end(), r);
    return ans;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms612 KiB
2Accepted1.363s508 KiB
subtask26/6
3Accepted1.417s620 KiB
4Accepted1.391s528 KiB
5Accepted1.381s424 KiB
6Accepted1.384s440 KiB
7Accepted1.314s484 KiB
subtask37/7
8Accepted3ms380 KiB
9Accepted4ms228 KiB
10Accepted3ms256 KiB
11Accepted4ms344 KiB
12Accepted4ms228 KiB
13Accepted41ms256 KiB
14Accepted52ms356 KiB
subtask410/10
15Accepted17ms584 KiB
16Accepted16ms352 KiB
17Accepted14ms628 KiB
18Accepted14ms528 KiB
19Accepted16ms356 KiB
20Accepted14ms392 KiB
21Accepted14ms384 KiB
22Accepted18ms324 KiB
23Accepted14ms380 KiB
24Accepted16ms288 KiB
25Accepted14ms228 KiB
26Accepted12ms504 KiB
27Accepted17ms356 KiB
28Accepted17ms356 KiB
29Accepted17ms360 KiB
subtask512/12
30Accepted17ms584 KiB
31Accepted16ms352 KiB
32Accepted14ms628 KiB
33Accepted14ms528 KiB
34Accepted16ms356 KiB
35Accepted14ms392 KiB
36Accepted14ms384 KiB
37Accepted18ms324 KiB
38Accepted14ms380 KiB
39Accepted16ms288 KiB
40Accepted14ms228 KiB
41Accepted12ms504 KiB
42Accepted17ms356 KiB
43Accepted17ms356 KiB
44Accepted17ms360 KiB
45Accepted74ms236 KiB
46Accepted78ms256 KiB
47Accepted75ms356 KiB
48Accepted82ms520 KiB
49Accepted78ms384 KiB
50Accepted74ms544 KiB
51Accepted78ms420 KiB
52Accepted75ms504 KiB
53Accepted79ms356 KiB
54Accepted79ms392 KiB
55Accepted78ms304 KiB
56Accepted79ms356 KiB
57Accepted74ms484 KiB
58Accepted76ms484 KiB
59Accepted81ms420 KiB
subtask642.48/65
60Accepted3ms336 KiB
61Accepted1.611s416 KiB
62Accepted1.417s620 KiB
63Accepted1.391s528 KiB
64Accepted1.381s424 KiB
65Accepted1.384s440 KiB
66Accepted1.314s484 KiB
67Accepted3ms380 KiB
68Accepted4ms228 KiB
69Accepted3ms256 KiB
70Accepted4ms344 KiB
71Accepted4ms228 KiB
72Accepted41ms256 KiB
73Accepted52ms356 KiB
74Accepted17ms584 KiB
75Accepted16ms352 KiB
76Accepted14ms628 KiB
77Accepted14ms528 KiB
78Accepted16ms356 KiB
79Accepted14ms392 KiB
80Accepted14ms384 KiB
81Accepted18ms324 KiB
82Accepted14ms380 KiB
83Accepted16ms288 KiB
84Accepted14ms228 KiB
85Accepted12ms504 KiB
86Accepted17ms356 KiB
87Accepted17ms356 KiB
88Accepted17ms360 KiB
89Accepted74ms236 KiB
90Accepted78ms256 KiB
91Accepted75ms356 KiB
92Accepted82ms520 KiB
93Accepted78ms384 KiB
94Accepted74ms544 KiB
95Accepted78ms420 KiB
96Accepted75ms504 KiB
97Accepted79ms356 KiB
98Accepted79ms392 KiB
99Accepted78ms304 KiB
100Accepted79ms356 KiB
101Accepted74ms484 KiB
102Accepted76ms484 KiB
103Accepted81ms420 KiB
104Partially correct1.633s544 KiB
105Partially correct1.402s420 KiB
106Partially correct1.511s488 KiB
107Partially correct1.491s612 KiB
108Partially correct1.468s436 KiB
109Partially correct1.46s488 KiB
110Partially correct1.427s520 KiB
111Accepted1.483s484 KiB
112Accepted1.475s504 KiB
113Accepted1.493s484 KiB
114Partially correct1.463s420 KiB
115Partially correct1.483s484 KiB
116Partially correct1.46s428 KiB
117Partially correct1.468s524 KiB
118Partially correct1.455s420 KiB
119Partially correct1.475s484 KiB
120Partially correct1.485s484 KiB
121Partially correct1.455s632 KiB
122Partially correct1.5s520 KiB
123Partially correct1.432s632 KiB
124Partially correct1.659s420 KiB
125Partially correct1.656s400 KiB
126Partially correct1.498s620 KiB
127Partially correct1.472s484 KiB
128Partially correct1.483s548 KiB
129Partially correct1.491s484 KiB
130Partially correct1.46s632 KiB
131Partially correct1.416s528 KiB
132Partially correct1.531s504 KiB