結果
問題 | No.346 チワワ数え上げ問題 |
ユーザー |
![]() |
提出日時 | 2016-03-01 09:13:07 |
言語 | Java (openjdk 23) |
結果 |
TLE
|
実行時間 | - |
コード長 | 699 bytes |
コンパイル時間 | 3,849 ms |
コンパイル使用メモリ | 78,964 KB |
実行使用メモリ | 62,584 KB |
最終ジャッジ日時 | 2024-09-24 13:00:14 |
合計ジャッジ時間 | 8,748 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | AC * 10 TLE * 1 -- * 12 |
ソースコード
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); } }