Submission #786620

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7866202023-07-18 10:23:17esomerScales (IOI15_scales)C++17
0 / 100
1 ms468 KiB
#include<bits/stdc++.h>
#include "scales.h"
using namespace std;
typedef long long ll;
void init(int T){}
int W[6];
void eras(vector<int>& left, int val){
vector<int> nw;
for(int x : left){
if(x == val) continue;
nw.push_back(x);
}
left = nw;
}
void orderCoins(){
vector<int> left = {1, 2, 3, 4, 5, 6};
int curr = 0;
while((int)left.size() > 2){
int a = getLightest(left[0], left[1], left[2]);
if((int)left.size() == 3){
W[curr] = a;
curr++;
eras(left, a);
continue;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:8:15: warning: unused parameter 'T' [-Wunused-parameter]
    8 | void init(int T){}
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:38:24: warning: 'c' may be used uninitialized in this function [-Wmaybe-uninitialized]
   38 |    int mn = getLightest(a, b, c);
      |             ~~~~~~~~~~~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...