結果
| 問題 | 
                            No.346 チワワ数え上げ問題
                             | 
                    
| コンテスト | |
| ユーザー | 
                             matsuyoshi30
                         | 
                    
| 提出日時 | 2018-09-11 23:01:24 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 651 bytes | 
| コンパイル時間 | 2,576 ms | 
| コンパイル使用メモリ | 74,308 KB | 
| 実行使用メモリ | 64,740 KB | 
| 最終ジャッジ日時 | 2024-06-24 09:26:31 | 
| 合計ジャッジ時間 | 15,001 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | -- * 3 | 
| other | AC * 10 TLE * 1 -- * 12 | 
ソースコード
import java.util.*;
class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        int l = s.length();
        int count = 0;
        char[] c = new char[3];
        for(int i=0; i<l; i++) {
            c[0] = s.charAt(i);
            for(int j=i+1; j<l; j++) {
                c[1] = s.charAt(j);
                for(int k=j+1; k<l; k++) {
                    c[2] = s.charAt(k);
                    String str = String.valueOf(c);;
                    if(str.equals("cww")) count++;
                }
            }
        }
        System.out.println(count);
    }
}
            
            
            
        
            
matsuyoshi30