結果
問題 |
No.239 にゃんぱすー
|
ユーザー |
![]() |
提出日時 | 2019-08-19 15:59:02 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 908 bytes |
コンパイル時間 | 151 ms |
コンパイル使用メモリ | 29,952 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-04 12:13:17 |
合計ジャッジ時間 | 1,078 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 3 |
other | AC * 11 WA * 22 |
ソースコード
#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); }