답안 #148232

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
148232 2019-08-31T18:07:17 Z 요까할 로뭘 은명팀 1(#3666, mario05092929) 백점을 받아랏! (FXCUP4_hundred) C++17
0 / 100
7 ms 384 KB
#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;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -