Submission #717708

#TimeUsernameProblemLanguageResultExecution timeMemory
717708Vlatko09Memory (IOI10_memory)C++14
0 / 100
15 ms272 KiB
#include "grader.h" #include "memory.h" void play() { char c[50]; int n[50]; for(int i=1;i<=50;i++) for(int j=i+1;j<=50;j++) { c[i]=faceup(i); n[i]=i; c[i+1]=faceup(j); n[i+1]=i; } for(int i=0;i<=50;i++) for(int j=0;j<=50;j++) { if(c[i]==c[j]) { faceup(i); faceup(j); } } }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:6:9: warning: variable 'n' set but not used [-Wunused-but-set-variable]
    6 |     int n[50];
      |         ^
memory.cpp:12:14: warning: iteration 48 invokes undefined behavior [-Waggressive-loop-optimizations]
   12 |        c[i+1]=faceup(j);
      |        ~~~~~~^~~~~~~~~~
memory.cpp:8:22: note: within this loop
    8 |       for(int j=i+1;j<=50;j++)
      |                     ~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...