Submission #707837

#TimeUsernameProblemLanguageResultExecution timeMemory
707837abcvuitunggio저울 (IOI15_scales)C++17
45.45 / 100
1 ms296 KiB
#include "scales.h"
#include <bits/stdc++.h>
using namespace std;
void init(int T) {
    /* ... */
}
 
void orderCoins() {
    /* ... */
    int W[] = {1, 2, 3, 4, 5, 6};
    vector <int> A,B,C;
    A.push_back(getLightest(1,2,3));
    A.push_back(getMedian(1,2,3));
    A.push_back(6-A[0]-A[1]);
    B.push_back(getLightest(4,5,6));
    B.push_back(getMedian(4,5,6));
    B.push_back(15-B[0]-B[1]);
    int i=0,j=0;
    while (i<3&&j<3){
        if (i==2&&j==2){
            int x=getHeaviest(A[i-1],A[i],B[j]);
            if (x==A[i]){
                C.push_back(B[j]);
                j++;
            }
            else{
                C.push_back(A[i]);
                i++;
            }
            continue;
        }
        int x=0;
        if (i<2)
            x=getLightest(A[i],A[i+1],B[j]);
        else
            x=getLightest(A[i],B[j],B[j+1]);
        C.push_back(x);
        if (x==A[i])
            i++;
        else
            j++;
    }
  	for (;i<3;i++)
        C.push_back(A[i]);
    for (;j<3;j++)
        C.push_back(B[j]);
    for (int i=0;i<6;i++)
        W[i]=C[i];
    answer(W);
}

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:4:15: warning: unused parameter 'T' [-Wunused-parameter]
    4 | void init(int T) {
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:47:14: warning: declaration of 'i' shadows a previous local [-Wshadow]
   47 |     for (int i=0;i<6;i++)
      |              ^
scales.cpp:18:9: note: shadowed declaration is here
   18 |     int i=0,j=0;
      |         ^
#Verdict Execution timeMemoryGrader output
Fetching results...