#include <bits/stdc++.h>
#include <scales.h>
using namespace std;
#define sz(x) (int) x.size()
#define dbg(x) cout << #x << ": " << x << endl;
using ll = long long;
void orderCoins(){
set<int> lista = {1, 2, 3, 4, 5, 6};
int a, b, c, d, e, z;
// encontrando a
int x = getLightest(1, 2, 3);
int y = getLightest(4, 5, 6);
int aux;
for(auto xx : lista){
if(xx != x && xx != y){
aux = xx;
break;
}
}
a = getLightest(x, y, aux);
lista.erase(a);
// encontrando b
// 2 3 4 5 6
auto it = lista.begin();
x = getLightest(*it, *(++it), *(++it));
b = getLightest(x, *(++it), *(++it));
lista.erase(b);
// encontrando z
// 3 4 5 6
it = lista.begin();
x = getHeaviest(*it, *(++it), *(++it));
z = getHeaviest(x, *(++it), a);
lista.erase(z);
// encontrando c
// 4 5 6
it = lista.begin();
c = getLightest(*it, *(++it), *(++it));
lista.erase(c);
// encontrando d
// 5 6
it = lista.begin();
d = getLightest(*it, *(++it), z);
lista.erase(d);
// sobra e
// 6
e = *lista.begin();
int xd[] = {a, b, c, d, e, z};
answer(xd);
}
void init(int T){
while(T--){
orderCoins();
}
}
Compilation message
scales.cpp: In function 'void orderCoins()':
scales.cpp:23:17: warning: 'aux' may be used uninitialized in this function [-Wmaybe-uninitialized]
23 | a = getLightest(x, y, aux);
| ~~~~~~~~~~~^~~~~~~~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
2 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
3 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
4 |
Runtime error |
1 ms |
424 KB |
Execution killed with signal 6 |
5 |
Runtime error |
1 ms |
428 KB |
Execution killed with signal 6 |
6 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
7 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
8 |
Runtime error |
1 ms |
424 KB |
Execution killed with signal 6 |
9 |
Runtime error |
2 ms |
428 KB |
Execution killed with signal 6 |
10 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
11 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
12 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
13 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
14 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
15 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
16 |
Runtime error |
1 ms |
424 KB |
Execution killed with signal 6 |
17 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
18 |
Runtime error |
1 ms |
440 KB |
Execution killed with signal 6 |
19 |
Runtime error |
1 ms |
428 KB |
Execution killed with signal 6 |
20 |
Runtime error |
1 ms |
424 KB |
Execution killed with signal 6 |
21 |
Runtime error |
1 ms |
432 KB |
Execution killed with signal 6 |
22 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
23 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
24 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
25 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
26 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
27 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
28 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
29 |
Runtime error |
1 ms |
424 KB |
Execution killed with signal 6 |
30 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
31 |
Runtime error |
1 ms |
424 KB |
Execution killed with signal 6 |
32 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
33 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
34 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
35 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
36 |
Runtime error |
1 ms |
384 KB |
Execution killed with signal 6 |
37 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
38 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
39 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |
40 |
Runtime error |
1 ms |
340 KB |
Execution killed with signal 6 |