結果

問題 No.436 ccw
ユーザー yuma_shobon1108yuma_shobon1108
提出日時 2016-12-02 19:20:12
言語 Java19
(openjdk 21)
結果
AC  
実行時間 201 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 2,243 ms
コンパイル使用メモリ 72,692 KB
実行使用メモリ 57,684 KB
最終ジャッジ日時 2023-08-18 12:26:13
合計ジャッジ時間 7,440 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
55,312 KB
testcase_01 AC 136 ms
55,744 KB
testcase_02 AC 129 ms
55,312 KB
testcase_03 AC 124 ms
55,488 KB
testcase_04 AC 128 ms
55,504 KB
testcase_05 AC 124 ms
55,604 KB
testcase_06 AC 123 ms
55,792 KB
testcase_07 AC 126 ms
57,684 KB
testcase_08 AC 123 ms
55,544 KB
testcase_09 AC 125 ms
55,524 KB
testcase_10 AC 126 ms
55,588 KB
testcase_11 AC 123 ms
55,608 KB
testcase_12 AC 124 ms
55,612 KB
testcase_13 AC 124 ms
55,740 KB
testcase_14 AC 130 ms
55,316 KB
testcase_15 AC 123 ms
55,608 KB
testcase_16 AC 139 ms
55,696 KB
testcase_17 AC 131 ms
55,372 KB
testcase_18 AC 142 ms
55,404 KB
testcase_19 AC 137 ms
55,612 KB
testcase_20 AC 136 ms
55,708 KB
testcase_21 AC 201 ms
56,344 KB
testcase_22 AC 195 ms
56,216 KB
testcase_23 AC 194 ms
56,056 KB
testcase_24 AC 189 ms
56,252 KB
testcase_25 AC 196 ms
56,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Question445
{
	public static void main(String[] str)
	{
	
		Scanner scan = new Scanner(System.in);
		
		String s = scan.next();
		int cnt = 0;
	
		for(int i=0;i<s.length();i++){
			if(s.charAt(i)=='w') break;
			else
				cnt++;
		}
		
		if(cnt>s.length()-cnt)
			System.out.println(s.length()-cnt);
		else
			System.out.println(cnt-1);

	}
}
0