#include "hundred.h"
#include <bits/stdc++.h>
using namespace std;
int c[105];
/// �κ� ���� 1 �����ô�.
string GetHundredPoints(int A, int B, int C) { // Ʋ���ڵ�
string ans;
string go;
int rans = 0;
for(int i = 0;i < 100;i++) c[i] = 0;
for(int i = 0;i < A;i++) go += 'A';
for(int i = 0;i < B;i++) go += 'B';
if(A == 100||B == 100) return go;
rans = Mark(go);
int la = 0,lb = A,ch;
while(rans != 100)
{
if(la >= A) la -= A;
if(lb >= 100) lb -= (100-A);
if(c[la])
{
la++;
continue;
}
if(c[lb])
{
lb++;
continue;
}
//cout << go << "\n";
swap(go[la],go[lb]);
ch = Mark(go);
if(rans == ch+2)
{
swap(go[la],go[lb]);
c[la] = c[lb] = 1;
la++; lb++;
}
else if(rans == ch-2)
{
rans += 2;
c[la] = c[lb] = 1;
la++; lb++;
}
else
{
swap(go[la],go[lb]);
la += 2; lb++;
}
}
return go;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |