제출 #545572

#제출 시각아이디문제언어결과실행 시간메모리
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++;
			}
		}
	}
}

컴파일 시 표준 에러 (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;
      |       ^
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…