結果

問題 No.346 チワワ数え上げ問題
ユーザー kenji_shioyakenji_shioya
提出日時 2016-05-29 05:30:37
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 624 bytes
コンパイル時間 4,313 ms
コンパイル使用メモリ 74,092 KB
実行使用メモリ 47,644 KB
最終ジャッジ日時 2024-04-16 18:13:09
合計ジャッジ時間 8,918 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
45,864 KB
testcase_01 AC 132 ms
41,060 KB
testcase_02 AC 127 ms
41,164 KB
testcase_03 AC 124 ms
41,152 KB
testcase_04 AC 136 ms
41,420 KB
testcase_05 AC 127 ms
41,084 KB
testcase_06 AC 130 ms
40,292 KB
testcase_07 AC 132 ms
41,292 KB
testcase_08 AC 130 ms
40,964 KB
testcase_09 AC 139 ms
41,336 KB
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Exercise30{
  public static void main (String[] args){

    Scanner sc = new Scanner(System.in);

    String str = sc.next();
    char[] charArray = str.toCharArray();

    int count = 0;

    for (int a = 0; a < charArray.length; a++){

      if (charArray[a] == 'c'){
        for (int b = a + 1; b < charArray.length; b++){
          if (charArray[b] == 'w'){
            for (int c = b + 1; c < charArray.length; c++){
              if (charArray[c] == 'w'){
                count++;
              }
            }
          }
        }
      }
    }

    System.out.println(count);
  }
}
0