Submission #117649

# Submission time Handle Problem Language Result Execution time Memory
117649 2019-06-17T04:00:41 Z imsifile Get Hundred Points! (FXCUP4_hundred) C++17
Compilation error
0 ms 0 KB
#include "hundred.h"
#include <stdio.h>
using namespace std;

string bas, tmp; int bsc, mms[111], zr;

void GetHundredPoints(int A, int B, int C) {
	for(int i=0; i<A; i++) bas += 'A';
	for(int i=0; i<B; i++) bas += 'B';
	for(int i=0; i<C; i++) bas += 'C';
	bsc = Mark(bas);
	for(int i=0; i<A; i++){
		tmp=bas; tmp[i]='B', tmp[A]='A';
		int cha = bsc-Mark(tmp);
		if(!cha) mms[i]=0;
		else{
			mms[i]=1;
			if(cha>0) zr=1; // i=A a=B
			else zr=0; // i=B a=A
		}
	}
	for(int i=A+1; i<100; i++){
		tmp=bas; tmp[0]='B', tmp[i]='A';
		int cha = bsc-Mark(tmp);
		if(!cha) mms[i]=mms[0];
		else{
			mms[i]=mms[0]^1;
			if(cha>0) zr=mms[0]; // 0=A i=B
			else zr=mms[0]^1; // 0=B i=A
		}
	}
	bas="";
	for(int i=0; i<100; i++) bas+="AB"[zr^mms[i]];
	Mark(bas);
}

Compilation message

hundred.cpp: In function 'void GetHundredPoints(int, int, int)':
hundred.cpp:7:6: error: ambiguating new declaration of 'void GetHundredPoints(int, int, int)'
 void GetHundredPoints(int A, int B, int C) {
      ^~~~~~~~~~~~~~~~
In file included from hundred.cpp:1:0:
hundred.h:3:13: note: old declaration 'std::__cxx11::string GetHundredPoints(int, int, int)'
 std::string GetHundredPoints(int A, int B, int C);
             ^~~~~~~~~~~~~~~~