Submission #34026


Source Code Expand

Copy
#include <stdio.h>
#include <string.h>
#include <stdlib.h>   // インクルードが必要

int main(int argc, const char * argv[])
{
	int i,tosen[10],bonas,takahasi[10],x,ans;
    char a[101];
    char s[100];
    ans=0;
    
    for (i=0; i<10; i++) {
        takahasi[i]=0;
        tosen[i]=0;
    }
    for (i=0; i<6; i++) {
        scanf("%s",&s);
        x=atoi(s);
        tosen[x]=1;
    }
    scanf("%d",&bonas);
    for (i=0; i<6; i++) {
        scanf("%s",&s);
        x=atoi(s);

        takahasi[x]=1;
        //printf("tosen  %d\n",x);

    }
    for (i=0; i<10; i++) {
            
        if (takahasi[i]==1) {
            //printf("takahasi%d\n",i);

            if (tosen[i]==1) {
                ans++;
               // printf("tosen%d\n",i);
            }
        }
    }
    switch (ans) {
        case 6:
            printf("1");

            break;
        case 5:
            if (takahasi[bonas]==1) {
                printf("2");

            }else {
                printf("3");

            }
            
            break;
        case 4:
            printf("4");
            
            break;
        case 3:
            printf("5");
            
            break;

        default:
            printf("0");

            break;
    }
    
 
    return 0;
}

Submission Info

Submission Time
Task A - 宝くじ
User masa3141
Language C (GCC 4.4.7)
Score 0
Code Size 1373 Byte
Status WA
Exec Time 24 ms
Memory 744 KB

Compile Error

./Main.c:4: warning: extra tokens at end of #include directive
./Main.c: In function ‘main’:
./Main.c:18: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘char (*)[100]’
./Main.c:24: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘char (*)[100]’
./Main.c:18: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result
./Main.c:22: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result
./Main.c:24: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
WA × 51
Set Name Test Cases
All 00_1_01.txt, 00_1_02.txt, 00_2_01.txt, 00_2_02.txt, 00_3_01.txt, 00_3_02.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 00_sample_05.txt, 01_rand_00.txt, 01_rand_01.txt, 01_rand_02.txt, 01_rand_03.txt, 01_rand_04.txt, 01_rand_05.txt, 01_rand_06.txt, 01_rand_07.txt, 01_rand_08.txt, 01_rand_09.txt, 01_rand_10.txt, 01_rand_11.txt, 01_rand_12.txt, 01_rand_13.txt, 01_rand_14.txt, 01_rand_15.txt, 01_rand_16.txt, 01_rand_17.txt, 01_rand_18.txt, 01_rand_19.txt, 01_rand_20.txt, 01_rand_21.txt, 01_rand_22.txt, 01_rand_23.txt, 01_rand_24.txt, 01_rand_25.txt, 01_rand_26.txt, 01_rand_27.txt, 01_rand_28.txt, 01_rand_29.txt, 01_rand_30.txt, 01_rand_31.txt, 01_rand_32.txt, 01_rand_33.txt, 01_rand_34.txt, 01_rand_35.txt, 01_rand_36.txt, 01_rand_37.txt, 01_rand_38.txt, 01_rand_39.txt
Case Name Status Exec Time Memory
00_1_01.txt WA 21 ms 672 KB
00_1_02.txt WA 20 ms 668 KB
00_2_01.txt WA 19 ms 656 KB
00_2_02.txt WA 20 ms 672 KB
00_3_01.txt WA 21 ms 724 KB
00_3_02.txt WA 21 ms 664 KB
00_sample_01.txt WA 20 ms 664 KB
00_sample_02.txt WA 21 ms 736 KB
00_sample_03.txt WA 23 ms 728 KB
00_sample_04.txt WA 21 ms 660 KB
00_sample_05.txt WA 18 ms 652 KB
01_rand_00.txt WA 19 ms 652 KB
01_rand_01.txt WA 24 ms 744 KB
01_rand_02.txt WA 22 ms 672 KB
01_rand_03.txt WA 20 ms 676 KB
01_rand_04.txt WA 20 ms 672 KB
01_rand_05.txt WA 21 ms 732 KB
01_rand_06.txt WA 20 ms 660 KB
01_rand_07.txt WA 18 ms 648 KB
01_rand_08.txt WA 21 ms 676 KB
01_rand_09.txt WA 22 ms 724 KB
01_rand_10.txt WA 18 ms 652 KB
01_rand_11.txt WA 20 ms 668 KB
01_rand_12.txt WA 20 ms 676 KB
01_rand_13.txt WA 18 ms 656 KB
01_rand_14.txt WA 18 ms 736 KB
01_rand_15.txt WA 21 ms 652 KB
01_rand_16.txt WA 22 ms 672 KB
01_rand_17.txt WA 21 ms 664 KB
01_rand_18.txt WA 19 ms 668 KB
01_rand_19.txt WA 21 ms 652 KB
01_rand_20.txt WA 21 ms 672 KB
01_rand_21.txt WA 18 ms 652 KB
01_rand_22.txt WA 19 ms 664 KB
01_rand_23.txt WA 18 ms 736 KB
01_rand_24.txt WA 18 ms 652 KB
01_rand_25.txt WA 18 ms 648 KB
01_rand_26.txt WA 18 ms 736 KB
01_rand_27.txt WA 18 ms 656 KB
01_rand_28.txt WA 23 ms 672 KB
01_rand_29.txt WA 20 ms 672 KB
01_rand_30.txt WA 18 ms 668 KB
01_rand_31.txt WA 21 ms 736 KB
01_rand_32.txt WA 20 ms 672 KB
01_rand_33.txt WA 21 ms 672 KB
01_rand_34.txt WA 20 ms 672 KB
01_rand_35.txt WA 18 ms 652 KB
01_rand_36.txt WA 18 ms 652 KB
01_rand_37.txt WA 18 ms 656 KB
01_rand_38.txt WA 20 ms 668 KB
01_rand_39.txt WA 22 ms 720 KB