結果

問題 No.436 ccw
ユーザー jimanojimano
提出日時 2018-02-10 17:08:30
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 589 bytes
コンパイル時間 3,024 ms
コンパイル使用メモリ 74,104 KB
実行使用メモリ 50,336 KB
最終ジャッジ日時 2024-04-22 17:53:36
合計ジャッジ時間 5,460 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
36,964 KB
testcase_01 AC 50 ms
37,044 KB
testcase_02 AC 51 ms
36,568 KB
testcase_03 AC 49 ms
37,084 KB
testcase_04 AC 50 ms
36,536 KB
testcase_05 AC 51 ms
36,836 KB
testcase_06 WA -
testcase_07 AC 50 ms
36,764 KB
testcase_08 AC 50 ms
37,044 KB
testcase_09 AC 49 ms
36,568 KB
testcase_10 AC 50 ms
36,980 KB
testcase_11 AC 50 ms
36,856 KB
testcase_12 AC 49 ms
37,092 KB
testcase_13 AC 50 ms
37,084 KB
testcase_14 AC 50 ms
37,044 KB
testcase_15 AC 50 ms
36,836 KB
testcase_16 AC 51 ms
37,012 KB
testcase_17 AC 50 ms
37,084 KB
testcase_18 AC 49 ms
36,576 KB
testcase_19 AC 51 ms
36,768 KB
testcase_20 AC 51 ms
36,800 KB
testcase_21 AC 79 ms
38,344 KB
testcase_22 AC 70 ms
38,308 KB
testcase_23 AC 66 ms
37,748 KB
testcase_24 AC 66 ms
37,908 KB
testcase_25 AC 62 ms
37,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package me.yukicoder;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No0436 {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String input = br.readLine();
		int length = input.length();
		int ans = 0;
		int left = input.indexOf("ccw");
		int mid = (length % 2 == 0)? length / 2 - 1: length / 2;
		
		if (left <= mid) {
			ans = left + 1;// to left
		}
		else {
			ans = length - left - 2;// to right
		}
		System.out.println(ans);
	}
}
0