結果
| 問題 | No.345 最小チワワ問題 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-23 15:02:08 |
| 言語 | C90(gcc15) (gcc 15.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 470 bytes |
| 記録 | |
| コンパイル時間 | 75 ms |
| コンパイル使用メモリ | 25,652 KB |
| 最終ジャッジ日時 | 2026-02-24 00:32:30 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c: In function 'main':
main.c:24:1: error: C++ style comments are not allowed in ISO C90
24 | // printf("%d\n",min);
| ^
main.c:24:1: note: (this will be reported only once per input file)
ソースコード
#include <stdio.h>
#include<string.h>
int main(void) {
int i,j,min=100,w=0,count=0;
char s[100];
scanf("%s",s);
for(i=0;i<strlen(s);i++){
w=0;
count=0;
if(s[i]=='c'){
count++;
for(j=i+1;j<strlen(s);j++){
if(s[j]== 'w'){
count++;
w++;
if(w==2){
if(min>count){
min=count;
}
// printf("%d\n",min);
break;
}
}else count++;
}
}
}
printf("%d",(min!=100? min : -1));
return 0;
}