제출 #343939

#제출 시각아이디문제언어결과실행 시간메모리
343939IwanttobreakfreeMemory (IOI10_memory)C++98
0 / 100
1 ms364 KiB
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include "grader.h"
#include "memory.h"
using namespace std;
void play() {
   int i,contador;
   char a[50];
   for (i=0; i<50; ++i) {
	a[i]=faceup(i+1);
}
	for(int b=0;b<50;b++){
		for(int c=49;c>b;c--){
			if(a[b]==a[c]){
				if (faceup(b)==faceup(c)) contador++;
			}
		}
		if (contador==25) return;
	}
}

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

memory.cpp: In function 'void play()':
memory.cpp:18:39: warning: 'contador' may be used uninitialized in this function [-Wmaybe-uninitialized]
   18 |     if (faceup(b)==faceup(c)) contador++;
      |                               ~~~~~~~~^~
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…