結果

問題 No.436 ccw
ユーザー yuma_shobon1108
提出日時 2016-12-02 19:20:12
言語 Java
(openjdk 23)
結果
AC  
実行時間 184 ms / 2,000 ms
コード長 374 bytes
コンパイル時間 1,911 ms
コンパイル使用メモリ 73,892 KB
実行使用メモリ 42,384 KB
最終ジャッジ日時 2024-11-27 17:26:56
合計ジャッジ時間 6,363 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

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