結果
| 問題 |
No.436 ccw
|
| コンテスト | |
| ユーザー |
ichiruisyu
|
| 提出日時 | 2016-11-02 15:52:54 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 316 bytes |
| コンパイル時間 | 151 ms |
| コンパイル使用メモリ | 20,480 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-25 01:29:58 |
| 合計ジャッジ時間 | 961 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 WA * 1 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%s", S);
| ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
int main()
{
int i, c_count, w_count;
char S[100003];
scanf("%s", S);
for(i=0; ;i++){
if(S[i] == 'w'){
c_count = i;
break;
}
}
w_count = strlen(S) - c_count;
if(c_count+1 > w_count)
printf("%d",w_count);
else
printf("%d",c_count-1);
return 0;
}
ichiruisyu