結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 1 ms
6,944 KB
testcase_09 WA -
testcase_10 WA -
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 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
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 WA -
testcase_28 AC 1 ms
6,940 KB
testcase_29 WA -
testcase_30 AC 1 ms
6,944 KB
testcase_31 AC 1 ms
6,940 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
権限があれば一括ダウンロードができます

ソースコード

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++)
        {
            if(i==j)
            {
                continue;
            }
            scanf("%s",greeting);
            if(strcmp(greeting,"nyanpass")==0)
            {
                villger[j]++;
            }
        }
    }
    int nyanpass=-1;
    int maxgreetcnt=-1;
    for(int i=0;i<people;i++)
    {
        if(villger[i]!=0)
        {        
            if(maxgreetcnt<villger[i])
            {
                maxgreetcnt=villger[i];
                nyanpass=i+1;
            }
            else if(maxgreetcnt==villger[i])
            {
                nyanpass=-1;
            }
        }
    }
    printf("%d",nyanpass);
}
0