제출 #552096

#제출 시각아이디문제언어결과실행 시간메모리
552096Trisanu_DasMemory (IOI10_memory)C++17
컴파일 에러
0 ms0 KiB
#include "grader.h"
using namespace std;
#include "memory.h"
#include <bits/stdc++.h>
 
void play() {
   // storing the positions of previously found values
   int pos[51] = {};
   for(int i = 1; i <= 50; i++) {
      int card = faceup(i);
     // if not previously found check with others
      if(pos[card] == 0) pos[r] = i, faceup(i % 50 + 1);
     // but if found earlier, get a chocolate!!
      else faceup(pos[card]);
   }
 
}

컴파일 시 표준 에러 (stderr) 메시지

memory.cpp: In function 'void play()':
memory.cpp:12:30: error: 'r' was not declared in this scope
   12 |       if(pos[card] == 0) pos[r] = i, faceup(i % 50 + 1);
      |                              ^