結果

問題 No.239 にゃんぱすー
ユーザー funakoshifunakoshi
提出日時 2019-08-19 15:39:35
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 772 bytes
コンパイル時間 506 ms
コンパイル使用メモリ 29,440 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 02:38:05
合計ジャッジ時間 1,538 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 WA -
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 1 ms
6,944 KB
testcase_09 AC 1 ms
6,944 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 1 ms
6,940 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 1 ms
6,940 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 1 ms
6,944 KB
testcase_21 WA -
testcase_22 AC 2 ms
6,940 KB
testcase_23 AC 2 ms
6,940 KB
testcase_24 AC 2 ms
6,940 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 1 ms
6,944 KB
testcase_28 AC 1 ms
6,944 KB
testcase_29 WA -
testcase_30 AC 2 ms
6,940 KB
testcase_31 AC 1 ms
6,944 KB
testcase_32 WA -
testcase_33 AC 2 ms
6,944 KB
testcase_34 AC 2 ms
6,944 KB
testcase_35 WA -
testcase_36 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
int main(void)
{
    int people;
    int villger[150]={0};
    char greeting[50]="";
    scanf("%d",&people);
    for(int i=0;i<people;i++)
    {
        for(int j=0;j<people;j++)
        {
            scanf("%s",greeting);
            if(strcmp(greeting,"nyanpass")==0)
            {
                villger[j]++;
            }
        }
    }
    int nyanpass=-1;
    int maxgreetcnt=-1;
    for(int i=0;i<people-1;i++)
    {        
        if(maxgreetcnt<villger[i])
        {
            maxgreetcnt=villger[i];
            nyanpass=i+1;
        }
        else if(maxgreetcnt==villger[i])
        {
            nyanpass=-1;
            break;
        }
    }
    printf("%d",nyanpass);
}
0