結果

問題 No.436 ccw
ユーザー yuma_shobon1108yuma_shobon1108
提出日時 2016-12-02 19:22:02
言語 Java19
(openjdk 21)
結果
AC  
実行時間 203 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 1,955 ms
コンパイル使用メモリ 71,428 KB
実行使用メモリ 56,912 KB
最終ジャッジ日時 2023-08-18 12:27:06
合計ジャッジ時間 6,736 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,576 KB
testcase_01 AC 120 ms
55,672 KB
testcase_02 AC 118 ms
55,776 KB
testcase_03 AC 120 ms
55,540 KB
testcase_04 AC 119 ms
55,660 KB
testcase_05 AC 120 ms
55,656 KB
testcase_06 AC 120 ms
55,588 KB
testcase_07 AC 118 ms
55,480 KB
testcase_08 AC 119 ms
55,736 KB
testcase_09 AC 119 ms
55,796 KB
testcase_10 AC 119 ms
55,736 KB
testcase_11 AC 120 ms
55,864 KB
testcase_12 AC 119 ms
55,620 KB
testcase_13 AC 120 ms
55,328 KB
testcase_14 AC 119 ms
55,592 KB
testcase_15 AC 116 ms
55,308 KB
testcase_16 AC 131 ms
55,628 KB
testcase_17 AC 126 ms
55,664 KB
testcase_18 AC 132 ms
55,648 KB
testcase_19 AC 132 ms
55,684 KB
testcase_20 AC 132 ms
55,580 KB
testcase_21 AC 191 ms
56,636 KB
testcase_22 AC 193 ms
56,376 KB
testcase_23 AC 198 ms
56,912 KB
testcase_24 AC 193 ms
56,128 KB
testcase_25 AC 203 ms
56,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Question436
{
	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