Submission #474053

#TimeUsernameProblemLanguageResultExecution timeMemory
474053ValiAntonieMemory (IOI10_memory)C++14
0 / 100
0 ms200 KiB
#include "grader.h" #include "memory.h" #include <bits/stdc++.h> using namespace std; void play() { // faceup(); int ap[100], path[100], nr; for(int i=1;i<=50;i++){ char x = faceup(i); if(ap[x] > 3) ap[x] = 0; ap[x]++; if(ap[x] == 1) path[x] = i; else{ if(i % 2 == 1) faceup(path[x]); else{ faceup(path[x]); faceup(i); } } if(ap[x] == 2) nr++; if(nr == 25) return; } }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:13:15: warning: array subscript has type 'char' [-Wchar-subscripts]
   13 |         if(ap[x] > 3)
      |               ^
memory.cpp:14:16: warning: array subscript has type 'char' [-Wchar-subscripts]
   14 |             ap[x] = 0;
      |                ^
memory.cpp:15:12: warning: array subscript has type 'char' [-Wchar-subscripts]
   15 |         ap[x]++;
      |            ^
memory.cpp:16:15: warning: array subscript has type 'char' [-Wchar-subscripts]
   16 |         if(ap[x] == 1)
      |               ^
memory.cpp:17:18: warning: array subscript has type 'char' [-Wchar-subscripts]
   17 |             path[x] = i;
      |                  ^
memory.cpp:20:29: warning: array subscript has type 'char' [-Wchar-subscripts]
   20 |                 faceup(path[x]);
      |                             ^
memory.cpp:22:29: warning: array subscript has type 'char' [-Wchar-subscripts]
   22 |                 faceup(path[x]);
      |                             ^
memory.cpp:26:15: warning: array subscript has type 'char' [-Wchar-subscripts]
   26 |         if(ap[x] == 2)
      |               ^
memory.cpp:27:15: warning: 'nr' may be used uninitialized in this function [-Wmaybe-uninitialized]
   27 |             nr++;
      |             ~~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...