(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #545572

#TimeUsernameProblemLanguageResultExecution timeMemory
545572pere_gilMemory (IOI10_memory)C++17
100 / 100
2 ms256 KiB
#include "bits/stdc++.h" #include "grader.h" #include "memory.h" using namespace std; void play() { int v[100]; memset(v,-1,sizeof v); for(int i=1;i<=50;i++){ char a=faceup(i); if(v[a]!=-1) faceup(v[a]); else{ v[a]=i; char b=faceup(i%50+1); if(b==a) i++; else if(v[b]==-1){ v[b]=i%50+1; i++; } } } }

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:11:8: warning: array subscript has type 'char' [-Wchar-subscripts]
   11 |   if(v[a]!=-1) faceup(v[a]);
      |        ^
memory.cpp:11:25: warning: array subscript has type 'char' [-Wchar-subscripts]
   11 |   if(v[a]!=-1) faceup(v[a]);
      |                         ^
memory.cpp:13:6: warning: array subscript has type 'char' [-Wchar-subscripts]
   13 |    v[a]=i;
      |      ^
memory.cpp:16:14: warning: array subscript has type 'char' [-Wchar-subscripts]
   16 |    else if(v[b]==-1){
      |              ^
memory.cpp:17:7: warning: array subscript has type 'char' [-Wchar-subscripts]
   17 |     v[b]=i%50+1;
      |       ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...