제출 #545564

#제출 시각아이디문제언어결과실행 시간메모리
545564pere_gilMemory (IOI10_memory)C++17
0 / 100
1 ms208 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+1)%50); if(v[b]==-1){ v[b]=(i+1)%50; i++; } } } }

컴파일 시 표준 에러 (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:15:9: warning: array subscript has type 'char' [-Wchar-subscripts]
   15 |    if(v[b]==-1){
      |         ^
memory.cpp:16:7: warning: array subscript has type 'char' [-Wchar-subscripts]
   16 |     v[b]=(i+1)%50;
      |       ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...