Submission #474058

# Submission time Handle Problem Language Result Execution time Memory
474058 2021-09-16T18:24:22 Z ValiAntonie Memory (IOI10_memory) C++14
Compilation error
0 ms 0 KB
void play() {
    // faceup();
    int ap[100], path[100], nr;
    for(int i=1;i<=50;i++){
        char x = faceup(i);
        if(ap[x] > 3)
            ap[x] = 0;
        ap[x]++;
        if(ap[x] == 1)
            path[x] = i;
        else{
            if(i % 2 == 1){
                faceup(path[x]);
                faceup(i);
            }
            else{
                faceup(path[x]);
                faceup(i);
            }
        }
    }
}

Compilation message

memory.cpp: In function 'void play()':
memory.cpp:5:18: error: 'faceup' was not declared in this scope
    5 |         char x = faceup(i);
      |                  ^~~~~~
memory.cpp:6:15: warning: array subscript has type 'char' [-Wchar-subscripts]
    6 |         if(ap[x] > 3)
      |               ^
memory.cpp:7:16: warning: array subscript has type 'char' [-Wchar-subscripts]
    7 |             ap[x] = 0;
      |                ^
memory.cpp:8:12: warning: array subscript has type 'char' [-Wchar-subscripts]
    8 |         ap[x]++;
      |            ^
memory.cpp:9:15: warning: array subscript has type 'char' [-Wchar-subscripts]
    9 |         if(ap[x] == 1)
      |               ^
memory.cpp:10:18: warning: array subscript has type 'char' [-Wchar-subscripts]
   10 |             path[x] = i;
      |                  ^
memory.cpp:13:29: warning: array subscript has type 'char' [-Wchar-subscripts]
   13 |                 faceup(path[x]);
      |                             ^
memory.cpp:17:29: warning: array subscript has type 'char' [-Wchar-subscripts]
   17 |                 faceup(path[x]);
      |                             ^
memory.cpp:3:29: warning: unused variable 'nr' [-Wunused-variable]
    3 |     int ap[100], path[100], nr;
      |                             ^~