結果

問題 No.436 ccw
ユーザー checkcheck12ch1checkcheck12ch1
提出日時 2016-11-10 17:00:41
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 377 bytes
コンパイル時間 81 ms
コンパイル使用メモリ 20,736 KB
実行使用メモリ 13,760 KB
最終ジャッジ日時 2024-05-04 01:26:02
合計ジャッジ時間 3,459 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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);
      |         ^~~~~~~~~~~~~

ソースコード

diff #

#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;
}
0