Submission #343939

#TimeUsernameProblemLanguageResultExecution timeMemory
343939IwanttobreakfreeMemory (IOI10_memory)C++98
0 / 100
1 ms364 KiB
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include "grader.h" #include "memory.h" using namespace std; void play() { int i,contador; char a[50]; for (i=0; i<50; ++i) { a[i]=faceup(i+1); } for(int b=0;b<50;b++){ for(int c=49;c>b;c--){ if(a[b]==a[c]){ if (faceup(b)==faceup(c)) contador++; } } if (contador==25) return; } }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:18:39: warning: 'contador' may be used uninitialized in this function [-Wmaybe-uninitialized]
   18 |     if (faceup(b)==faceup(c)) contador++;
      |                               ~~~~~~~~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...