結果
| 問題 | 
                            No.342 一番ワロタww
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2016-02-12 23:03:01 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,176 bytes | 
| コンパイル時間 | 3,491 ms | 
| コンパイル使用メモリ | 78,488 KB | 
| 実行使用メモリ | 54,460 KB | 
| 最終ジャッジ日時 | 2024-09-22 04:50:25 | 
| 合計ジャッジ時間 | 6,415 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 13 WA * 1 | 
ソースコード
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class Main_yukicoder342 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int n = s.length();
        List<String> str = new ArrayList<String>();
        List<Integer> len = new ArrayList<Integer>();
        int max = 0;
        int i = 0;
        while (i < n) {
        	int j = s.indexOf('w', i);
        	if (j == -1){
//        		str.add(s.substring(i, n));
//        		len.add(0);
        		break;
        	} else if (j == 0) {
        	} else {
        		str.add(s.substring(i, j));
        		i = j;
        	}
        	int tmp = 0;
        	while (i < n && s.charAt(i) == 'w') {
        		tmp++;
        		i++;
        	}
        	if (j > 0) {
        		len.add(tmp);
        		max = Math.max(max, tmp);
        	}
        }
        if (str.size() == 0) {
        	System.out.println();
        } else {
        	for (int j = 0; j < str.size(); j++) {
        		if (len.get(j) == max) {
        			System.out.println(str.get(j));
        		}
        	}
        }
        sc.close();
    }
}