Submission #372550

#TimeUsernameProblemLanguageResultExecution timeMemory
372550meperdonas203Memory (IOI10_memory)C++17
Compilation error
0 ms0 KiB
#include "grader.h" #include "memory.h" void play() { int poscicion_1[52]; int poscicion_2[52]; for(int i=1;i<=50;i++){ poscicion_1[i]=0; poscicion_2[i]=0; } char c; int ini=1; int fin=50; for(int i=1;i<=25;i++){ c=faceup(ini); if(poscicion_1[c-64]>0){ poscicion_1[c-64]=i; }else{ poscicion_2[c-64]=i; } c=faceup[fin]; if(poscicion_1[c-64]>0){ poscicion_1[c-64]=fin; }else{ poscicion_2[c-64]=fin; } ini++; fin--; } for(int i=1;i<=50;i++){ faceup(poscicion_1[i]); faceup(poscicion_2[i]); } }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:21:21: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   21 |         c=faceup[fin];
      |                     ^
memory.cpp:21:21: error: invalid conversion from 'char (*)(int)' to 'char' [-fpermissive]
   21 |         c=faceup[fin];
      |           ~~~~~~~~~~^
      |                     |
      |                     char (*)(int)