結果

問題 No.436 ccw
ユーザー OGNMOGNM
提出日時 2016-11-12 23:35:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 209 ms / 2,000 ms
コード長 478 bytes
コンパイル時間 3,135 ms
コンパイル使用メモリ 72,180 KB
実行使用メモリ 57,716 KB
最終ジャッジ日時 2023-08-17 04:02:30
合計ジャッジ時間 8,030 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,692 KB
testcase_01 AC 118 ms
56,036 KB
testcase_02 AC 120 ms
55,924 KB
testcase_03 AC 119 ms
55,848 KB
testcase_04 AC 119 ms
55,792 KB
testcase_05 AC 120 ms
56,088 KB
testcase_06 AC 119 ms
55,880 KB
testcase_07 AC 119 ms
55,888 KB
testcase_08 AC 118 ms
55,976 KB
testcase_09 AC 119 ms
55,840 KB
testcase_10 AC 121 ms
55,904 KB
testcase_11 AC 124 ms
56,120 KB
testcase_12 AC 126 ms
55,392 KB
testcase_13 AC 120 ms
55,820 KB
testcase_14 AC 122 ms
55,744 KB
testcase_15 AC 119 ms
55,612 KB
testcase_16 AC 155 ms
55,984 KB
testcase_17 AC 132 ms
55,688 KB
testcase_18 AC 156 ms
55,956 KB
testcase_19 AC 154 ms
55,424 KB
testcase_20 AC 154 ms
54,068 KB
testcase_21 AC 209 ms
57,492 KB
testcase_22 AC 206 ms
57,120 KB
testcase_23 AC 208 ms
57,400 KB
testcase_24 AC 208 ms
56,844 KB
testcase_25 AC 207 ms
57,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Study_01 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        int index = s.indexOf("ccw");
        int sL = s.length();
        int last = sL - index - 3;
        if(index > last){
        	System.out.println(last + 1);
        }else if(last > index){
        	System.out.println(index + 1);
        }else if(index == 0){
        	System.out.println(1);
        }
    }
}
0