Submission #4171


Source Code Expand

#include <stdio.h>

int main(int argc, char* argv[]) {
    int n;
    scanf("%d", &n);
    char ans[101];
    scanf("%s", ans);
    
    int i;
    int c1 = 0, c2 = 0, c3 = 0, c4 = 0;
    for(i = 0; i < n; i++) {
        char num = ans[i];
        switch(num) {
            case '1': c1++; break;
            case '2': c2++; break;
            case '3': c3++; break;
            case '4': c4++; break;
        }
    }
    
    if(c1 > c2) {
        if(c1 > c3) {
            printf("%d ", (c1>c4)? c1: c4);
        } else {
            printf("%d ", (c3>c4)? c3: c4);
        }
    } else {
        if(c2 > c3) {
            printf("%d ", (c2>c4)? c2: c4);
        } else {
            printf("%d ", (c3>c4)? c3: c4);
        }
    }
    
    if(c1 < c2) {
        if(c1 < c3) {
            printf("%d\n", (c1<c4)? c1: c4);
        } else {
            printf("%d\n", (c3<c4)? c3: c4);
        }
    } else {
        if(c2 < c3) {
            printf("%d\n", (c2<c4)? c2: c4);
        } else {
            printf("%d\n", (c3<c4)? c3: c4);
        }
    }
    
    return 0;
}

Submission Info

Submission Time
Task A - センター採点
User hitting1024
Language C (GCC 4.4.7)
Score 100
Code Size 1123 Byte
Status AC
Exec Time 21 ms
Memory 600 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result
./Main.c:7: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result

Judge Result

Set Name all
Score / Max Score 100 / 100
Status
AC × 30
Set Name Test Cases
all 00_sample1.txt, 00_sample2.txt, 01_rnd_00.txt, 01_rnd_01.txt, 01_rnd_02.txt, 01_rnd_03.txt, 01_rnd_04.txt, 01_rnd_05.txt, 01_rnd_06.txt, 01_rnd_07.txt, 01_rnd_08.txt, 01_rnd_09.txt, 01_rnd_10.txt, 01_rnd_11.txt, 01_rnd_12.txt, 01_rnd_13.txt, 01_rnd_14.txt, 01_rnd_15.txt, 01_rnd_16.txt, 01_rnd_17.txt, 01_rnd_18.txt, 01_rnd_19.txt, 02_all_1.txt, 02_all_2.txt, 02_all_3.txt, 02_all_4.txt, 03_mini_1.txt, 03_mini_2.txt, 03_mini_3.txt, 03_mini_4.txt
Case Name Status Exec Time Memory
00_sample1.txt AC 16 ms 128 KB
00_sample2.txt AC 18 ms 128 KB
01_rnd_00.txt AC 18 ms 128 KB
01_rnd_01.txt AC 16 ms 128 KB
01_rnd_02.txt AC 18 ms 128 KB
01_rnd_03.txt AC 17 ms 0 KB
01_rnd_04.txt AC 18 ms 128 KB
01_rnd_05.txt AC 18 ms 128 KB
01_rnd_06.txt AC 16 ms 128 KB
01_rnd_07.txt AC 18 ms 592 KB
01_rnd_08.txt AC 18 ms 576 KB
01_rnd_09.txt AC 18 ms 592 KB
01_rnd_10.txt AC 18 ms 128 KB
01_rnd_11.txt AC 18 ms 576 KB
01_rnd_12.txt AC 16 ms 128 KB
01_rnd_13.txt AC 18 ms 128 KB
01_rnd_14.txt AC 18 ms 128 KB
01_rnd_15.txt AC 18 ms 128 KB
01_rnd_16.txt AC 18 ms 128 KB
01_rnd_17.txt AC 19 ms 128 KB
01_rnd_18.txt AC 17 ms 128 KB
01_rnd_19.txt AC 17 ms 588 KB
02_all_1.txt AC 17 ms 588 KB
02_all_2.txt AC 18 ms 592 KB
02_all_3.txt AC 16 ms 128 KB
02_all_4.txt AC 18 ms 128 KB
03_mini_1.txt AC 21 ms 128 KB
03_mini_2.txt AC 18 ms 584 KB
03_mini_3.txt AC 18 ms 600 KB
03_mini_4.txt AC 17 ms 0 KB