結果
| 問題 |
No.239 にゃんぱすー
|
| ユーザー |
Bantako
|
| 提出日時 | 2017-07-10 22:18:21 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 533 bytes |
| コンパイル時間 | 116 ms |
| コンパイル使用メモリ | 23,424 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-07 07:15:45 |
| 合計ジャッジ時間 | 1,117 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
4 | main(){
| ^~~~
main.cpp: In function ‘int main()’:
main.cpp:6:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d",&N);
| ~~~~~^~~~~~~~~
main.cpp:10:18: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%s",str);
| ~~~~~^~~~~~~~~~
ソースコード
#include<stdio.h>
#include<string.h>
int count[100];
main(){
int N;
scanf("%d",&N);
for(int i = 0;i < N;i++){
for(int j = 0;j < N;j++){
char str[31];
scanf("%s",str);
if(strcmp(str,"nyanpass")==0){count[j]++;}
}
}
int num = -1;
for(int i = 0;i < N;i++){
if(count[i]==(N-1)){
if(num == -1){
num=i+1;
}else{
num = -1;
break;
}
}
}
printf("%d\n",num);
}
Bantako