Submission #755305

#TimeUsernameProblemLanguageResultExecution timeMemory
755305vjudge1Memory (IOI10_memory)C++17
100 / 100
3 ms208 KiB
#include <bits/stdc++.h> #include "grader.h" #include "memory.h" using namespace std; void play() { int pont1=1, pont2=2, last[100], mark[55], cont=0; for(int i=0 ; i<90 ; i++) last[i] =0; while(cont < 50){ char a, b; a = faceup(pont1); b = faceup(pont2); if(last[a] != 0){ char t, u; t = faceup(last[a]); u = faceup(pont1); cont += 2; }else last[a] = pont1; if(last[b] != 0){ char t, u; t = faceup(last[b]); u = faceup(pont2); cont += 2; }else last[b] = pont2; pont1 += 2; pont2 += 2; } return; }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:19:15: warning: array subscript has type 'char' [-Wchar-subscripts]
   19 |       if(last[a] != 0){
      |               ^
memory.cpp:22:26: warning: array subscript has type 'char' [-Wchar-subscripts]
   22 |          t = faceup(last[a]);
      |                          ^
memory.cpp:21:15: warning: variable 't' set but not used [-Wunused-but-set-variable]
   21 |          char t, u;
      |               ^
memory.cpp:21:18: warning: variable 'u' set but not used [-Wunused-but-set-variable]
   21 |          char t, u;
      |                  ^
memory.cpp:26:18: warning: array subscript has type 'char' [-Wchar-subscripts]
   26 |       }else last[a] = pont1;
      |                  ^
memory.cpp:28:15: warning: array subscript has type 'char' [-Wchar-subscripts]
   28 |       if(last[b] != 0){
      |               ^
memory.cpp:31:26: warning: array subscript has type 'char' [-Wchar-subscripts]
   31 |          t = faceup(last[b]);
      |                          ^
memory.cpp:30:15: warning: variable 't' set but not used [-Wunused-but-set-variable]
   30 |          char t, u;
      |               ^
memory.cpp:30:18: warning: variable 'u' set but not used [-Wunused-but-set-variable]
   30 |          char t, u;
      |                  ^
memory.cpp:35:18: warning: array subscript has type 'char' [-Wchar-subscripts]
   35 |       }else last[b] = pont2;
      |                  ^
memory.cpp:9:37: warning: unused variable 'mark' [-Wunused-variable]
    9 |    int pont1=1, pont2=2, last[100], mark[55], cont=0;
      |                                     ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...