結果

問題 No.342 一番ワロタww
ユーザー uafr_csuafr_cs
提出日時 2016-02-12 23:14:58
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 989 bytes
コンパイル時間 3,027 ms
コンパイル使用メモリ 76,020 KB
実行使用メモリ 57,624 KB
最終ジャッジ日時 2023-10-22 03:27:56
合計ジャッジ時間 6,277 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
56,208 KB
testcase_01 AC 127 ms
57,616 KB
testcase_02 AC 129 ms
57,484 KB
testcase_03 AC 129 ms
57,624 KB
testcase_04 AC 132 ms
57,472 KB
testcase_05 AC 130 ms
57,224 KB
testcase_06 AC 131 ms
57,480 KB
testcase_07 WA -
testcase_08 AC 142 ms
57,352 KB
testcase_09 AC 132 ms
57,424 KB
testcase_10 AC 129 ms
57,464 KB
testcase_11 AC 130 ms
57,520 KB
testcase_12 AC 132 ms
57,252 KB
testcase_13 AC 129 ms
57,528 KB
testcase_14 AC 129 ms
57,524 KB
testcase_15 AC 131 ms
57,212 KB
testcase_16 AC 128 ms
57,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		final String input = sc.next().replaceFirst("^w+", "");
		final Pattern pat = Pattern.compile("(([^w]+)(w+))");
		
		//System.out.println(input + " " + pat);
		final Matcher mat = pat.matcher(input);
		
		LinkedList<String> answer = new LinkedList<String>();
		int max_len = 0;
		
		while(mat.find()){
			final String in = mat.group(2);
			final int w_len = mat.group(3).length();
			
			if(max_len > w_len){ continue; }
			if(max_len < w_len){ max_len = w_len; answer.clear(); }
			
			answer.add(in);
		}
		
		if(answer.size() == 0){ /* System.out.println(); */ }
		else{
			for(final String ans : answer){
				System.out.println(ans);
			}
		}
		
	}

}
0