Submission #707830

#TimeUsernameProblemLanguageResultExecution timeMemory
707830abcvuitunggio저울 (IOI15_scales)C++17
Compilation error
0 ms0 KiB
#include "scales.h"

void init(int T) {
    /* ... */
}

void orderCoins() {
    /* ... */
    int W[] = {1, 2, 3, 4, 5, 6};
    vector <int> A,B,C;
    int x=
    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 (int i=0;i<6;i++)
        W[i]=C[i];
    answer(W);
}

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:3:15: warning: unused parameter 'T' [-Wunused-parameter]
    3 | void init(int T) {
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:10:5: error: 'vector' was not declared in this scope
   10 |     vector <int> A,B,C;
      |     ^~~~~~
scales.cpp:10:13: error: expected primary-expression before 'int'
   10 |     vector <int> A,B,C;
      |             ^~~
scales.cpp:12:5: error: 'A' was not declared in this scope
   12 |     A.push_back(getLightest(1,2,3));
      |     ^
scales.cpp:15:5: error: 'B' was not declared in this scope
   15 |     B.push_back(getLightest(4,5,6));
      |     ^
scales.cpp:21:17: warning: declaration of 'x' shadows a previous local [-Wshadow]
   21 |             int x=getHeaviest(A[i-1],A[i],B[j]);
      |                 ^
scales.cpp:11:9: note: shadowed declaration is here
   11 |     int x=
      |         ^
scales.cpp:23:17: error: 'C' was not declared in this scope
   23 |                 C.push_back(B[j]);
      |                 ^
scales.cpp:27:17: error: 'C' was not declared in this scope
   27 |                 C.push_back(A[i]);
      |                 ^
scales.cpp:32:13: warning: declaration of 'x' shadows a previous local [-Wshadow]
   32 |         int x=0;
      |             ^
scales.cpp:11:9: note: shadowed declaration is here
   11 |     int x=
      |         ^
scales.cpp:37:9: error: 'C' was not declared in this scope
   37 |         C.push_back(x);
      |         ^
scales.cpp:43:14: warning: declaration of 'i' shadows a previous local [-Wshadow]
   43 |     for (int i=0;i<6;i++)
      |              ^
scales.cpp:18:9: note: shadowed declaration is here
   18 |     int i=0,j=0;
      |         ^
scales.cpp:44:14: error: 'C' was not declared in this scope
   44 |         W[i]=C[i];
      |              ^
scales.cpp:11:9: warning: unused variable 'x' [-Wunused-variable]
   11 |     int x=
      |         ^