結果
問題 |
No.342 一番ワロタww
|
ユーザー |
![]() |
提出日時 | 2016-02-18 22:47:57 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,123 bytes |
コンパイル時間 | 2,370 ms |
コンパイル使用メモリ | 78,660 KB |
実行使用メモリ | 53,496 KB |
最終ジャッジ日時 | 2024-09-22 12:07:39 |
合計ジャッジ時間 | 4,253 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | RE * 3 |
other | AC * 3 WA * 1 RE * 10 |
ソースコード
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.InputMismatchException; import java.util.NoSuchElementException; import java.math.BigInteger; public class Main{ static PrintWriter out; static BufferedReader ir; static void solve() throws IOException{ String s=ir.readLine(); ArrayList<String> ans=new ArrayList<>(); ans.add(""); int l=0,ma=0; while(l<s.length()&&s.charAt(l)=='w') l++; ma=l; for(int i=l;i<s.length();i++){ if(s.charAt(i)=='w'){ int st=i; while(i<s.length()&&s.charAt(i)=='w') i++; l=i; if(i-st>ma){ ma=i-st; ans.clear(); ans.add(s.substring(l,st)); } else if(i-st==ma) ans.add(s.substring(l,st)); i--; } } for(String ss : ans){ out.println(ss); } } public static void main(String[] args) throws Exception{ ir=new BufferedReader(new InputStreamReader(System.in,"UTF-8")); out=new PrintWriter(System.out); solve(); out.flush(); } }