# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
117644 | imsifile | Get Hundred Points! (FXCUP4_hundred) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "hundred.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; // bas[A]='B'
else zr=0; // bas[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]=0;
else{
mms[i]=1;
if(cha>0) zr=mms[0]^1; // bas[0]='B'
else zr=mms[0]; // bas[0]='A'
}
}
bas="";
for(int i=0; i<100; i++) bas+="AB"[zr^mms[i]];
Mark(bas);
}