結果

問題 No.342 一番ワロタww
ユーザー ぴろずぴろず
提出日時 2016-02-12 22:32:00
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 772 bytes
コンパイル時間 2,368 ms
コンパイル使用メモリ 76,808 KB
実行使用メモリ 57,604 KB
最終ジャッジ日時 2023-10-22 03:13:02
合計ジャッジ時間 5,308 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 123 ms
57,148 KB
testcase_02 AC 132 ms
57,328 KB
testcase_03 AC 121 ms
57,368 KB
testcase_04 AC 124 ms
57,312 KB
testcase_05 AC 124 ms
57,316 KB
testcase_06 AC 124 ms
57,284 KB
testcase_07 WA -
testcase_08 AC 128 ms
57,568 KB
testcase_09 AC 131 ms
57,340 KB
testcase_10 AC 127 ms
57,020 KB
testcase_11 AC 125 ms
57,540 KB
testcase_12 AC 121 ms
57,048 KB
testcase_13 AC 122 ms
57,264 KB
testcase_14 WA -
testcase_15 AC 130 ms
57,308 KB
testcase_16 AC 123 ms
57,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no342;

import java.util.ArrayList;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {

	public static final char kusa = 'w';
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		Pattern p = Pattern.compile("[^w]+w*");
		Matcher m = p.matcher(sc.next());
		int max = 0;
		ArrayList<String> ans = new ArrayList<>();
		while(m.find()) {
			String s = m.group();
			int count = 0;
			for(int i=0;i<s.length();i++) {
				if (s.charAt(i) == kusa) {
					count++;
				}
			}
			if (max <= count) {
				if (max < count) {
					ans.clear();
				}
				ans.add(s.substring(0,s.length()-count));
				max = count;
			}
		}
		for(String s:ans) {
			System.out.println(s);
		}
	}
}
0