結果

問題 No.436 ccw
ユーザー kenji_shioyakenji_shioya
提出日時 2016-10-29 11:50:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 198 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 3,486 ms
コンパイル使用メモリ 72,348 KB
実行使用メモリ 56,440 KB
最終ジャッジ日時 2023-08-16 06:36:10
合計ジャッジ時間 8,384 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,584 KB
testcase_01 AC 121 ms
55,708 KB
testcase_02 AC 124 ms
55,352 KB
testcase_03 AC 126 ms
55,792 KB
testcase_04 AC 125 ms
55,436 KB
testcase_05 AC 127 ms
55,728 KB
testcase_06 AC 124 ms
55,388 KB
testcase_07 AC 126 ms
55,612 KB
testcase_08 AC 124 ms
55,488 KB
testcase_09 AC 126 ms
55,348 KB
testcase_10 AC 124 ms
55,636 KB
testcase_11 AC 124 ms
55,724 KB
testcase_12 AC 126 ms
55,628 KB
testcase_13 AC 123 ms
55,704 KB
testcase_14 AC 127 ms
55,632 KB
testcase_15 AC 124 ms
55,408 KB
testcase_16 AC 138 ms
55,592 KB
testcase_17 AC 130 ms
55,772 KB
testcase_18 AC 138 ms
55,872 KB
testcase_19 AC 138 ms
55,892 KB
testcase_20 AC 138 ms
55,736 KB
testcase_21 AC 193 ms
56,244 KB
testcase_22 AC 191 ms
56,440 KB
testcase_23 AC 195 ms
56,416 KB
testcase_24 AC 198 ms
56,392 KB
testcase_25 AC 188 ms
56,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Exercise161 {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String str = sc.next();

    int cCount = str.lastIndexOf('c');
    int total = str.length();
    int wCount = total - (cCount + 1);

    System.out.println(Math.min(cCount, wCount));
  }
}
0