結果
問題 | No.436 ccw |
ユーザー |
![]() |
提出日時 | 2016-11-12 23:35:05 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 192 ms / 2,000 ms |
コード長 | 478 bytes |
コンパイル時間 | 3,250 ms |
コンパイル使用メモリ | 75,604 KB |
実行使用メモリ | 43,064 KB |
最終ジャッジ日時 | 2024-11-25 21:41:58 |
合計ジャッジ時間 | 7,497 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
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); } } }