結果

問題 No.342 一番ワロタww
ユーザー uafr_csuafr_cs
提出日時 2016-02-12 23:16:59
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 983 bytes
コンパイル時間 2,871 ms
コンパイル使用メモリ 78,912 KB
実行使用メモリ 57,652 KB
最終ジャッジ日時 2023-10-22 03:28:39
合計ジャッジ時間 5,861 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
56,216 KB
testcase_01 AC 112 ms
55,288 KB
testcase_02 AC 101 ms
55,764 KB
testcase_03 AC 108 ms
57,208 KB
testcase_04 AC 102 ms
56,244 KB
testcase_05 AC 113 ms
57,404 KB
testcase_06 AC 116 ms
57,520 KB
testcase_07 WA -
testcase_08 AC 122 ms
57,652 KB
testcase_09 AC 110 ms
57,084 KB
testcase_10 AC 110 ms
57,484 KB
testcase_11 AC 112 ms
57,228 KB
testcase_12 AC 106 ms
56,196 KB
testcase_13 AC 105 ms
56,092 KB
testcase_14 AC 114 ms
57,220 KB
testcase_15 AC 115 ms
57,540 KB
testcase_16 AC 114 ms
57,416 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