結果

問題 No.342 一番ワロタww
ユーザー uafr_csuafr_cs
提出日時 2016-02-12 23:06:23
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 983 bytes
コンパイル時間 2,309 ms
コンパイル使用メモリ 79,192 KB
実行使用メモリ 41,284 KB
最終ジャッジ日時 2023-10-22 03:24:48
合計ジャッジ時間 4,965 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
39,848 KB
testcase_01 AC 129 ms
41,024 KB
testcase_02 AC 115 ms
41,064 KB
testcase_03 AC 111 ms
41,152 KB
testcase_04 AC 104 ms
41,096 KB
testcase_05 AC 115 ms
39,864 KB
testcase_06 AC 111 ms
41,064 KB
testcase_07 WA -
testcase_08 AC 122 ms
40,920 KB
testcase_09 AC 101 ms
40,976 KB
testcase_10 AC 110 ms
41,068 KB
testcase_11 AC 113 ms
41,284 KB
testcase_12 AC 116 ms
41,088 KB
testcase_13 AC 110 ms
41,032 KB
testcase_14 AC 110 ms
41,208 KB
testcase_15 AC 102 ms
41,032 KB
testcase_16 AC 115 ms
41,004 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