結果

問題 No.342 一番ワロタww
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-05-20 21:02:15
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 789 bytes
コンパイル時間 2,441 ms
コンパイル使用メモリ 76,188 KB
実行使用メモリ 57,772 KB
最終ジャッジ日時 2023-09-11 00:08:58
合計ジャッジ時間 5,235 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 RE -
testcase_15 RE -
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import static java.lang.System.*;
import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		String s = sc.nextLine();
		s = s.replaceFirst("^w+","");
		out.println(s);
		s = s.replaceAll("[^w]+$","");
		out.println(s);
		
		List<String> listA = new LinkedList(Arrays.asList(s.split("w+")));
		List<String> listB = new LinkedList(Arrays.asList(s.split("[^w]+",0)));
		listB.remove(0);

		int max = Integer.MIN_VALUE;
		for (int i=0; i<listB.size(); i++) {
			if (listB.get(i).length() > max) {
				max = listB.get(i).length();
			}
		}
		
		if (listA.size()==0) {
			out.println(""); return;
		}
		
		for (int i=0; i<listA.size(); i++) {
			if (listB.get(i).length() == max) out.println(listA.get(i));
		}
	}
}
0