結果
問題 | No.495 (^^*) Easy |
ユーザー |
|
提出日時 | 2017-10-08 21:54:41 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 104 ms / 2,000 ms |
コード長 | 777 bytes |
コンパイル時間 | 2,205 ms |
コンパイル使用メモリ | 77,836 KB |
実行使用メモリ | 39,972 KB |
最終ジャッジ日時 | 2024-11-17 05:48:26 |
合計ジャッジ時間 | 3,143 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 7 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class No495{ public static void main(String[] args) { try{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int left = 0; int right = 0; Hantei(br,left,right); } catch(IOException e){ e.getStackTrace(); } catch(NumberFormatException e){ e.getStackTrace(); } } public static void Hantei(BufferedReader br, int left, int right) throws IOException{ String str = br.readLine(); boolean bln = true; int i = 0; while(bln){ if(str.charAt(5*i) == '#'){ bln = false; } else if(str.charAt(5*i+3) == '*'){ left++; i++; } else { right++; i++; } } System.out.println(left +" "+ right); } }