結果

問題 No.239 にゃんぱすー
ユーザー funakoshifunakoshi
提出日時 2019-08-20 09:40:49
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 977 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 30,848 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 01:58:51
合計ジャッジ時間 1,051 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 1 ms
5,376 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
5,376 KB
testcase_23 AC 2 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 1 ms
5,376 KB
testcase_29 WA -
testcase_30 AC 1 ms
5,376 KB
testcase_31 AC 1 ms
5,376 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)
{
    char greeting[100]="";
    int villger[110]={0};
    int numofvillger;
    scanf("%d",&numofvillger);
    for(int i=0;i<numofvillger;i++)
    {
        for(int j=0;j<numofvillger;j++)
        {
            if(i==j)
            {
                continue;
            }
            scanf("%s",greeting);
            if(strcmp(greeting,"nyanpass")==0)
            {
                villger[j]++;
            }
        }
    }
    int maxgreettimes=0,ren=-1;
    bool identify = false;
    for(int i=0;i<numofvillger;i++)
    {
        if(maxgreettimes<villger[i])
        {
            maxgreettimes=villger[i];
            ren=i+1;
            identify=true;
        }
        else if(maxgreettimes==villger[i])
        {
            identify=false;
        }
    }
    if(identify==false)
    {
        printf("-1");
    }
    else
    {
        printf("%d",ren);
    }
    
}
0