답안 #201898

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
201898 2020-02-12T18:02:29 Z Leonardo_Paes Memory (IOI10_memory) C++17
컴파일 오류
0 ms 0 KB
#include "grader.h"
#include "memory.h"

void play() {
    std::vector<int> p[100];
    int i=1, j=50, a;
    while(i<j){
        a = faceup(i) - 'A';
        p[a].push_back(i);
        a = faceup(j) - 'A';
        p[a].push_back(j);
        i++, j--;
    }
    for(i=0; i<25; i++)
        faceup(p[i][0]); faceup(p[i][1]);
}

Compilation message

memory.cpp: In function 'void play()':
memory.cpp:5:10: error: 'vector' is not a member of 'std'
     std::vector<int> p[100];
          ^~~~~~
memory.cpp:5:17: error: expected primary-expression before 'int'
     std::vector<int> p[100];
                 ^~~
memory.cpp:9:9: error: 'p' was not declared in this scope
         p[a].push_back(i);
         ^
memory.cpp:15:16: error: 'p' was not declared in this scope
         faceup(p[i][0]); faceup(p[i][1]);
                ^
memory.cpp:14:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
     for(i=0; i<25; i++)
     ^~~
memory.cpp:15:26: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
         faceup(p[i][0]); faceup(p[i][1]);
                          ^~~~~~
memory.cpp:15:33: error: 'p' was not declared in this scope
         faceup(p[i][0]); faceup(p[i][1]);
                                 ^