結果
| 問題 | 
                            No.342 一番ワロタww
                             | 
                    
| コンテスト | |
| ユーザー | 
                             holeguma
                         | 
                    
| 提出日時 | 2016-02-18 22:45:38 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,129 bytes | 
| コンパイル時間 | 2,359 ms | 
| コンパイル使用メモリ | 78,980 KB | 
| 実行使用メモリ | 53,336 KB | 
| 最終ジャッジ日時 | 2024-09-22 12:07:34 | 
| 合計ジャッジ時間 | 4,203 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | RE * 3 | 
| other | AC * 3 WA * 1 RE * 10 | 
ソースコード
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.math.BigInteger;
public class Main{
    static PrintWriter out;
    static BufferedReader ir;
    static void solve() throws IOException{
		String s=ir.readLine();
		ArrayList<String> ans=new ArrayList<>();
		ans.add("");
		int l=0,ma=0;
		while(l<s.length()&&s.charAt(l)=='w') l++;
		ma=l;
		for(int i=l;i<s.length();i++){
			if(s.charAt(i)=='w'){
				int st=i;
				while(i<s.length()&&s.charAt(i)=='w') i++;
				l=i;
				if(i-st+1>ma){
					ma=i-st+1;
					ans.clear();
					ans.add(s.substring(l,st));
				}
				else if(i-st+1==ma) ans.add(s.substring(l,st));
				i--;
			}
		}
		for(String ss : ans){
			out.println(ss);
		}
	}
	public static void main(String[] args) throws Exception{
		ir=new BufferedReader(new InputStreamReader(System.in,"UTF-8"));
		out=new PrintWriter(System.out);
		solve();
		out.flush();
	}
}
            
            
            
        
            
holeguma