結果
問題 |
No.436 ccw
|
ユーザー |
|
提出日時 | 2018-02-10 17:08:30 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 589 bytes |
コンパイル時間 | 2,870 ms |
コンパイル使用メモリ | 72,772 KB |
実行使用メモリ | 37,800 KB |
最終ジャッジ日時 | 2024-10-14 17:03:38 |
合計ジャッジ時間 | 5,246 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 WA * 1 |
ソースコード
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); } }