답안 #147547

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
147547 2019-08-30T01:43:18 Z admin 백점을 받아랏! (FXCUP4_hundred) C++17
33 / 100
8 ms 384 KB
#include "hundred.h"
#include <stdio.h>
using namespace std;
 
string bas, tmp; int bsc, mms[111], zr;
 
string 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]];
	return (bas);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 256 KB Output is correct
2 Correct 8 ms 304 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 7 ms 256 KB Output is correct
5 Correct 8 ms 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 256 KB Output is correct
2 Correct 8 ms 304 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 7 ms 256 KB Output is correct
5 Correct 8 ms 336 KB Output is correct
6 Incorrect 6 ms 256 KB Output isn't correct
7 Halted 0 ms 0 KB -