10990 | 2024-05-02 16:46:56 | mraron | Kutyák és macskák | cpp17 | Partially correct 92.15/100 | 1.274s | 692 KiB |
#include "KutyakMacskak.h"
#include<algorithm>
std::vector<int> find_order(int N, int M) {
int fm=1;
for(int i=2;i<=M;++i) {
if(ask(1,fm,i)==fm) fm=i;
}
std::vector<int> ms;
for(int i=1;i<=M;++i) if(i!=fm) ms.push_back(i);
int ind=0, kind=1;
while(ind<ms.size()) {
if(ask(kind,ms[ind],fm)==fm) {
ind++;
}else {
kind++;
}
}
std::vector<int> res={ms[0]};
for(int i=1;i<ms.size();++i) {
auto it=upper_bound(res.begin(), res.end(), ms[i], [&](int x, int y) -> bool {
return ask(kind, x, y)==x;
});
res.insert(it, ms[i]);
}
res.insert(res.begin(), fm);
return res;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 400 KiB | ||||
2 | Accepted | 1.197s | 524 KiB | ||||
subtask2 | 6/6 | ||||||
3 | Accepted | 1.07s | 408 KiB | ||||
4 | Accepted | 1.11s | 504 KiB | ||||
5 | Accepted | 1.103s | 528 KiB | ||||
6 | Accepted | 1.12s | 424 KiB | ||||
7 | Accepted | 1.151s | 436 KiB | ||||
subtask3 | 7/7 | ||||||
8 | Accepted | 3ms | 396 KiB | ||||
9 | Accepted | 3ms | 504 KiB | ||||
10 | Accepted | 3ms | 616 KiB | ||||
11 | Accepted | 4ms | 384 KiB | ||||
12 | Accepted | 3ms | 368 KiB | ||||
13 | Accepted | 35ms | 500 KiB | ||||
14 | Accepted | 39ms | 356 KiB | ||||
subtask4 | 10/10 | ||||||
15 | Accepted | 10ms | 384 KiB | ||||
16 | Accepted | 8ms | 300 KiB | ||||
17 | Accepted | 10ms | 256 KiB | ||||
18 | Accepted | 9ms | 500 KiB | ||||
19 | Accepted | 12ms | 488 KiB | ||||
20 | Accepted | 12ms | 408 KiB | ||||
21 | Accepted | 9ms | 420 KiB | ||||
22 | Accepted | 12ms | 384 KiB | ||||
23 | Accepted | 9ms | 356 KiB | ||||
24 | Accepted | 9ms | 384 KiB | ||||
25 | Accepted | 9ms | 384 KiB | ||||
26 | Accepted | 8ms | 256 KiB | ||||
27 | Accepted | 10ms | 452 KiB | ||||
28 | Accepted | 13ms | 616 KiB | ||||
29 | Accepted | 13ms | 384 KiB | ||||
subtask5 | 12/12 | ||||||
30 | Accepted | 10ms | 384 KiB | ||||
31 | Accepted | 8ms | 300 KiB | ||||
32 | Accepted | 10ms | 256 KiB | ||||
33 | Accepted | 9ms | 500 KiB | ||||
34 | Accepted | 12ms | 488 KiB | ||||
35 | Accepted | 12ms | 408 KiB | ||||
36 | Accepted | 9ms | 420 KiB | ||||
37 | Accepted | 12ms | 384 KiB | ||||
38 | Accepted | 9ms | 356 KiB | ||||
39 | Accepted | 9ms | 384 KiB | ||||
40 | Accepted | 9ms | 384 KiB | ||||
41 | Accepted | 8ms | 256 KiB | ||||
42 | Accepted | 10ms | 452 KiB | ||||
43 | Accepted | 13ms | 616 KiB | ||||
44 | Accepted | 13ms | 384 KiB | ||||
45 | Accepted | 57ms | 356 KiB | ||||
46 | Accepted | 52ms | 376 KiB | ||||
47 | Accepted | 52ms | 360 KiB | ||||
48 | Accepted | 57ms | 408 KiB | ||||
49 | Accepted | 64ms | 484 KiB | ||||
50 | Accepted | 52ms | 420 KiB | ||||
51 | Accepted | 63ms | 408 KiB | ||||
52 | Accepted | 52ms | 356 KiB | ||||
53 | Accepted | 54ms | 424 KiB | ||||
54 | Accepted | 64ms | 632 KiB | ||||
55 | Accepted | 59ms | 424 KiB | ||||
56 | Accepted | 56ms | 484 KiB | ||||
57 | Accepted | 56ms | 356 KiB | ||||
58 | Accepted | 56ms | 384 KiB | ||||
59 | Accepted | 63ms | 384 KiB | ||||
subtask6 | 57.15/65 | ||||||
60 | Accepted | 3ms | 384 KiB | ||||
61 | Accepted | 1.09s | 564 KiB | ||||
62 | Accepted | 1.07s | 408 KiB | ||||
63 | Accepted | 1.11s | 504 KiB | ||||
64 | Accepted | 1.103s | 528 KiB | ||||
65 | Accepted | 1.12s | 424 KiB | ||||
66 | Accepted | 1.151s | 436 KiB | ||||
67 | Accepted | 3ms | 396 KiB | ||||
68 | Accepted | 3ms | 504 KiB | ||||
69 | Accepted | 3ms | 616 KiB | ||||
70 | Accepted | 4ms | 384 KiB | ||||
71 | Accepted | 3ms | 368 KiB | ||||
72 | Accepted | 35ms | 500 KiB | ||||
73 | Accepted | 39ms | 356 KiB | ||||
74 | Accepted | 10ms | 384 KiB | ||||
75 | Accepted | 8ms | 300 KiB | ||||
76 | Accepted | 10ms | 256 KiB | ||||
77 | Accepted | 9ms | 500 KiB | ||||
78 | Accepted | 12ms | 488 KiB | ||||
79 | Accepted | 12ms | 408 KiB | ||||
80 | Accepted | 9ms | 420 KiB | ||||
81 | Accepted | 12ms | 384 KiB | ||||
82 | Accepted | 9ms | 356 KiB | ||||
83 | Accepted | 9ms | 384 KiB | ||||
84 | Accepted | 9ms | 384 KiB | ||||
85 | Accepted | 8ms | 256 KiB | ||||
86 | Accepted | 10ms | 452 KiB | ||||
87 | Accepted | 13ms | 616 KiB | ||||
88 | Accepted | 13ms | 384 KiB | ||||
89 | Accepted | 57ms | 356 KiB | ||||
90 | Accepted | 52ms | 376 KiB | ||||
91 | Accepted | 52ms | 360 KiB | ||||
92 | Accepted | 57ms | 408 KiB | ||||
93 | Accepted | 64ms | 484 KiB | ||||
94 | Accepted | 52ms | 420 KiB | ||||
95 | Accepted | 63ms | 408 KiB | ||||
96 | Accepted | 52ms | 356 KiB | ||||
97 | Accepted | 54ms | 424 KiB | ||||
98 | Accepted | 64ms | 632 KiB | ||||
99 | Accepted | 59ms | 424 KiB | ||||
100 | Accepted | 56ms | 484 KiB | ||||
101 | Accepted | 56ms | 356 KiB | ||||
102 | Accepted | 56ms | 384 KiB | ||||
103 | Accepted | 63ms | 384 KiB | ||||
104 | Partially correct | 1.136s | 692 KiB | ||||
105 | Partially correct | 1.123s | 544 KiB | ||||
106 | Accepted | 1.133s | 492 KiB | ||||
107 | Partially correct | 1.12s | 452 KiB | ||||
108 | Partially correct | 1.274s | 428 KiB | ||||
109 | Partially correct | 1.261s | 548 KiB | ||||
110 | Partially correct | 1.118s | 552 KiB | ||||
111 | Accepted | 1.133s | 548 KiB | ||||
112 | Accepted | 1.111s | 612 KiB | ||||
113 | Accepted | 1.11s | 612 KiB | ||||
114 | Partially correct | 1.116s | 424 KiB | ||||
115 | Partially correct | 1.131s | 612 KiB | ||||
116 | Partially correct | 1.167s | 620 KiB | ||||
117 | Partially correct | 1.161s | 484 KiB | ||||
118 | Partially correct | 1.128s | 556 KiB | ||||
119 | Partially correct | 1.146s | 612 KiB | ||||
120 | Partially correct | 1.149s | 612 KiB | ||||
121 | Partially correct | 1.11s | 484 KiB | ||||
122 | Partially correct | 1.139s | 612 KiB | ||||
123 | Partially correct | 1.139s | 444 KiB | ||||
124 | Partially correct | 1.129s | 536 KiB | ||||
125 | Partially correct | 1.136s | 428 KiB | ||||
126 | Partially correct | 1.138s | 492 KiB | ||||
127 | Partially correct | 1.156s | 492 KiB | ||||
128 | Partially correct | 1.187s | 504 KiB | ||||
129 | Partially correct | 1.162s | 580 KiB | ||||
130 | Partially correct | 1.136s | 676 KiB | ||||
131 | Partially correct | 1.082s | 516 KiB | ||||
132 | Partially correct | 1.021s | 536 KiB |