# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
946286 |
2024-03-14T13:22:26 Z |
Nika533 |
Scales (IOI15_scales) |
C++14 |
|
1 ms |
600 KB |
#pragma GCC diagnostic warning "-std=c++11"
#include <bits/stdc++.h>
#include "scales.h"
#define pb push_back
#define f first
#define s second
#define MOD 1000000007
#define flush fflush(stdout)
#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(), (x).rend()
#define pii pair<int,int>
using namespace std;
int n,m,k;
void init(int T) {
}
void orderCoins() {
int w[6];
int a[6];
a[2]=getLightest(1,2,3);
a[1]=getMedian(1,2,3);
if (a[1]!=1 && a[2]!=1) a[0]=1;
if (a[1]!=2 && a[2]!=2) a[0]=2;
if (a[1]!=3 && a[2]!=3) a[0]=3;
a[5]=getLightest(4,5,6);
a[4]=getMedian(4,5,6);
if (a[4]!=4 && a[5]!=4) a[3]=4;
if (a[4]!=5 && a[5]!=5) a[3]=5;
if (a[4]!=6 && a[5]!=6) a[3]=6;
int x3=getNextLightest(1,2,3,a[3]);
int x4=getNextLightest(1,2,3,a[4]);
int x5=getNextLightest(1,2,3,a[5]);
for (int i=0; i<3; i++) {
if (a[i]==x3) {
x3=i; break;
}
}
for (int i=0; i<3; i++) {
if (a[i]==x4) {
x4=i; break;
}
}
for (int i=0; i<3; i++) {
if (a[i]==x5) {
x5=i; break;
}
}
if (x3==2) x3=3;
if (x4==2) x4=3;
if (x5==2) x5=3;
if (x3==3) {
if (x4!=3 || x5!=3) x3=-1;
}
if (x4==3) {
if (x3!=3) x4=2;
if (x5!=3) x4=-1;
}
if (x5==3) {
if (x3!=3 || x4!=3) x3=2;
}
if (x3==3 && x4==3 && x5==3) {
if (getHeaviest(1,2,a[4])==a[4]) {
x3=-1; x4=-1;
if (getHeaviest(1,2,a[5])==a[5]) {
x5=-1;
}
else x5=2;
}
else {
x4=2; x5=2;
if (getHeaviest(1,2,a[3])==a[3]) {
x3=-1;
}
else {
x3=2;
}
}
}
int ind=0;
for (int i=0; i<3; i++) {
if (x3==i-1) {
w[ind]=a[3];
ind++;
}
if (x4==i-1) {
w[ind]=a[4];
ind++;
}
if (x5==i-1) {
w[ind]=a[5];
ind++;
}
w[ind]=a[i];
ind++;
}
if (x3==2) {
w[ind]=a[3];
ind++;
}
if (x4==2) {
w[ind]=a[4];
ind++;
}
if (x5==2) {
w[ind]=a[5];
ind++;
}
reverse(w,w+6);
answer(w);
}
Compilation message
scales.cpp:1:32: warning: '-std=c++11' is not an option that controls warnings [-Wpragmas]
1 | #pragma GCC diagnostic warning "-std=c++11"
| ^~~~~~~~~~~~
scales.cpp: In function 'void init(int)':
scales.cpp:15:15: warning: unused parameter 'T' [-Wunused-parameter]
15 | void init(int T) {
| ~~~~^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
7 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
10 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
11 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
12 |
Incorrect |
0 ms |
600 KB |
Output isn't correct |
13 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
14 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
15 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
16 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
17 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
18 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
19 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
20 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
21 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
22 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
23 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
24 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
25 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
26 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
27 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
28 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
29 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
30 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
31 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
32 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
33 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
34 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
35 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
36 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
37 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
38 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
39 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
40 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |