結果

問題 No.342 一番ワロタww
ユーザー ぴろずぴろず
提出日時 2016-02-12 22:30:58
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 703 bytes
コンパイル時間 4,226 ms
コンパイル使用メモリ 85,184 KB
実行使用メモリ 57,720 KB
最終ジャッジ日時 2023-10-22 03:12:53
合計ジャッジ時間 6,103 ms
ジャッジサーバーID
(参考情報)
judge10 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
57,376 KB
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 AC 130 ms
56,952 KB
testcase_15 AC 133 ms
56,988 KB
testcase_16 WA -
権限があれば一括ダウンロードができます

ソースコード

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));
			}
		}
	}
}
0