結果
問題 | No.346 チワワ数え上げ問題 |
ユーザー | mizunomi32 |
提出日時 | 2016-03-01 09:13:07 |
言語 | Java21 (openjdk 21) |
結果 |
TLE
|
実行時間 | - |
コード長 | 699 bytes |
コンパイル時間 | 4,038 ms |
コンパイル使用メモリ | 75,020 KB |
実行使用メモリ | 57,400 KB |
最終ジャッジ日時 | 2023-10-24 19:17:15 |
合計ジャッジ時間 | 9,655 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 129 ms
57,392 KB |
testcase_01 | AC | 120 ms
57,304 KB |
testcase_02 | AC | 121 ms
57,136 KB |
testcase_03 | AC | 122 ms
57,292 KB |
testcase_04 | AC | 121 ms
57,268 KB |
testcase_05 | AC | 122 ms
57,064 KB |
testcase_06 | AC | 123 ms
56,844 KB |
testcase_07 | AC | 110 ms
56,144 KB |
testcase_08 | AC | 118 ms
57,400 KB |
testcase_09 | AC | 129 ms
57,328 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 | -- | - |
ソースコード
import java.util.Scanner; public class main { public static void main (String[] args){ Scanner sc = new Scanner(System.in); String S=sc.nextLine(); char[] chars = S.toCharArray(); int slen= S.length(); int count =0; for(int i =0;i<slen;i++){ if(chars[i]=='c'){ for(int j =1 ; j<slen-i;j++) { if(chars[i+j]=='w'){ for (int k =1;k<slen -i-j;k++) if(chars[i+j+k]=='w'){ count++; } } } } } System.out.println(count); } }