結果

問題 No.342 一番ワロタww
ユーザー mizunomi32
提出日時 2016-03-01 10:03:03
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 825 bytes
コンパイル時間 3,206 ms
コンパイル使用メモリ 74,868 KB
実行使用メモリ 54,548 KB
最終ジャッジ日時 2024-09-24 13:01:25
合計ジャッジ時間 6,305 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 3
other RE * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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

        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        String[] str={""};
        int[] scount={0};
        int slen = S.length();
        String buf = "";
        int count =0 ,j=1;

        for(int i =0;i< slen;i++){

            if (S.charAt(i) == 'w'){
                count++;
                j=i+1;
                for(int k = 0;scount[k]<count;k++){
                    str[k]=buf;
                    scount[k]=count;
                }

            }else {
                count = 0;
                buf = S.substring(j,i);

            }
        }
        System.out.println(str[0]);
        for(int i=1;scount[i] == scount[0];i++){
            System.out.println(str[i]);
        }

    }
}
0