結果
| 問題 |
No.436 ccw
|
| ユーザー |
checkcheck12ch1
|
| 提出日時 | 2016-11-10 17:00:41 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 377 bytes |
| コンパイル時間 | 96 ms |
| コンパイル使用メモリ | 20,736 KB |
| 実行使用メモリ | 15,184 KB |
| 最終ジャッジ日時 | 2024-11-25 07:15:20 |
| 合計ジャッジ時間 | 48,931 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 TLE * 1 |
| other | AC * 1 WA * 8 TLE * 15 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:11:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%s",s);
| ^~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
int main(void) {
int c = 0;
int w = 0;
int i;
int j;
int l;
char s[100001];
scanf("%s",s);
l = strlen(s);
j = l / 2;
while (s[j] == 'c') {
j = j / 2;
}
for (i = j;i < l;i++) {
if(s[i] == 'w') {
c = i;
w = l - c;
break;
}
}
if (c-1 > w) {
printf("%d\n",w);
}
else {
printf("%d\n",c-1);
}
return 0;
}
checkcheck12ch1