제출 #775540

#제출 시각아이디문제언어결과실행 시간메모리
775540DobromirAngelovMemory (IOI10_memory)C++14
100 / 100
2 ms336 KiB
#include<bits/stdc++.h>
#include "grader.h"

using namespace std;

void play()
{
    int found[256]={0};
    int ptr=1;
    int cnt=0;
    while(cnt<25)
    {
        char x=faceup(ptr++);
        if(found[x])
        {
            faceup(found[x]);
            cnt++;
        }
        else
        {
            found[x]=ptr-1;
            char y=faceup(ptr++);
            if(found[y])
            {
                faceup(ptr-1);
                faceup(found[y]);
                cnt++;
            }
            else found[y]=ptr-1;
        }
    }
}

컴파일 시 표준 에러 (stderr) 메시지

memory.cpp: In function 'void play()':
memory.cpp:14:18: warning: array subscript has type 'char' [-Wchar-subscripts]
   14 |         if(found[x])
      |                  ^
memory.cpp:16:26: warning: array subscript has type 'char' [-Wchar-subscripts]
   16 |             faceup(found[x]);
      |                          ^
memory.cpp:21:19: warning: array subscript has type 'char' [-Wchar-subscripts]
   21 |             found[x]=ptr-1;
      |                   ^
memory.cpp:23:22: warning: array subscript has type 'char' [-Wchar-subscripts]
   23 |             if(found[y])
      |                      ^
memory.cpp:26:30: warning: array subscript has type 'char' [-Wchar-subscripts]
   26 |                 faceup(found[y]);
      |                              ^
memory.cpp:29:24: warning: array subscript has type 'char' [-Wchar-subscripts]
   29 |             else found[y]=ptr-1;
      |                        ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...