Submission #1372205


Source Code Expand

#include <cstdio>

#define MAXN 100

//FILE *fin = fopen("a.in","r");
//FILE *fout = fopen("a.out", "w");
int f[3];
char m[3][MAXN+1];
int card(int n) {
    char x = m[n][f[n]];
    f[n]--;
    if(f[n] == 0)
        return n;
    int t = x - 'a';
    return card(t);
}

int main() {
    int rez;
    char castigator;
    for (int n = 0; n <= 2; n++) {
        char ch = fgetc(stdin);
        while(ch != '\n') {
            f[n]++;
            m[n][f[n]] = ch;
            ch = fgetc(stdin);
        }
    }
    rez = card(0);
    castigator = 'A'+rez;
    fputc(castigator, stdout);
    return 0;
}

Submission Info

Submission Time
Task B - Card Game for Three (ABC Edit)
User FizZ
Language C++14 (GCC 5.4.1)
Score 0
Code Size 633 Byte
Status WA
Exec Time 0 ms
Memory 128 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 200
Status AC
AC × 11
WA × 1
Set Name Test Cases
Sample
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
01.txt AC 0 ms 128 KB
02.txt WA 0 ms 128 KB
03.txt AC 0 ms 128 KB
04.txt AC 0 ms 128 KB
05.txt AC 0 ms 128 KB
06.txt AC 0 ms 128 KB
07.txt AC 0 ms 128 KB
08.txt AC 0 ms 128 KB
09.txt AC 0 ms 128 KB
10.txt AC 0 ms 128 KB
sample_01.txt AC 0 ms 128 KB
sample_02.txt AC 0 ms 128 KB