# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
31260 |
2017-08-16T15:02:04 Z |
top34051 |
Scales (IOI15_scales) |
C++14 |
|
0 ms |
2024 KB |
#include "scales.h"
#include<bits/stdc++.h>
using namespace std;
vector<int> p,a,b,tp;
void init(int T) {
}
void orderCoins() {
int i,x,temp,mn,t1,t2;
int W[] = {1, 2, 3, 4, 5, 6};
a.clear(); b.clear();
t1 = getLightest(1,2,3);
t2 = getLightest(4,5,6);
for(i=1;i<=3;i++) {
if(i!=t1 && i!=t2) {
mn = getLightest(i,t1,t2);
break;
}
}
for(i=1;i<=3;i++) if(i!=mn) a.push_back(i);
for(i=4;i<=6;i++) if(i!=mn) b.push_back(i);
if(a.size()>b.size()) swap(a,b);
p.clear();
p.push_back(mn);
for(i=0;i<b.size();i++) p.push_back(b[i]);
cerr << "p : ";
for(i=0;i<p.size();i++) cerr << p[i] << " ";
cerr << "\n";
cerr << "a : ";
for(i=0;i<a.size();i++) cerr << a[i] << " ";
cerr << "\n";
x = a[0];
temp = getNextLightest(p[0],p[1],p[2],x);
if(temp==p[0]) {
temp = getNextLightest(p[0],p[1],p[3],x);
if(temp==p[0]) p.push_back(x);
else {
tp.clear();
for(i=0;i<p.size();i++) {
if(temp==p[i]) tp.push_back(x);
tp.push_back(p[i]);
}
p = tp;
}
}
else {
tp.clear();
for(i=0;i<p.size();i++) {
if(temp==p[i]) tp.push_back(x);
tp.push_back(p[i]);
}
p = tp;
}
x = a[1];
temp = getNextLightest(p[0],p[1],p[2],x);
if(temp==p[0]) {
temp = getNextLightest(p[0],p[3],p[4],x);
if(temp==p[0]) p.push_back(x);
else {
tp.clear();
for(i=0;i<p.size();i++) {
if(temp==p[i]) tp.push_back(x);
tp.push_back(p[i]);
}
p = tp;
}
}
else {
tp.clear();
for(i=0;i<p.size();i++) {
if(temp==p[i]) tp.push_back(x);
tp.push_back(p[i]);
}
p = tp;
}
for(i=0;i<6;i++) W[i] = p[i];
answer(W);
}
Compilation message
scales.cpp:7:15: warning: unused parameter 'T' [-Wunused-parameter]
void init(int T) {
^
scales.cpp: In function 'void orderCoins()':
scales.cpp:29:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(i=0;i<b.size();i++) p.push_back(b[i]);
^
scales.cpp:32:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(i=0;i<p.size();i++) cerr << p[i] << " ";
^
scales.cpp:36:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(i=0;i<a.size();i++) cerr << a[i] << " ";
^
scales.cpp:46:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(i=0;i<p.size();i++) {
^
scales.cpp:55:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(i=0;i<p.size();i++) {
^
scales.cpp:69:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(i=0;i<p.size();i++) {
^
scales.cpp:78:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(i=0;i<p.size();i++) {
^
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
3 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
4 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
5 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
6 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
7 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
8 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
9 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
10 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
11 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
12 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
13 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
14 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
15 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
16 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
17 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
18 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
19 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
20 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
21 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
22 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
23 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
24 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
25 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
26 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
27 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
28 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
29 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
30 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
31 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
32 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
33 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
34 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
35 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
36 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
37 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
38 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
39 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |
40 |
Incorrect |
0 ms |
2024 KB |
Output isn't correct |