結果
| 問題 |
No.239 にゃんぱすー
|
| ユーザー |
funakoshi
|
| 提出日時 | 2019-08-19 15:43:45 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 856 bytes |
| コンパイル時間 | 914 ms |
| コンパイル使用メモリ | 28,672 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-04 11:28:48 |
| 合計ジャッジ時間 | 1,254 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 28 WA * 5 |
ソースコード
#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;i++)
{
if(villger[i]!=0)
{
if(maxgreetcnt<villger[i])
{
maxgreetcnt=villger[i];
nyanpass=i+1;
}
else if(maxgreetcnt==villger[i])
{
nyanpass=-1;
break;
}
}
}
printf("%d",nyanpass);
}
funakoshi