結果
| 問題 |
No.342 一番ワロタww
|
| コンテスト | |
| ユーザー |
ぴろず
|
| 提出日時 | 2016-02-12 22:30:58 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 703 bytes |
| コンパイル時間 | 2,191 ms |
| コンパイル使用メモリ | 76,388 KB |
| 実行使用メモリ | 56,512 KB |
| 最終ジャッジ日時 | 2024-09-22 04:42:14 |
| 合計ジャッジ時間 | 5,120 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 3 WA * 11 |
ソースコード
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));
}
}
}
}
ぴろず