結果
問題 | No.423 ハムスター語初級(数詞) |
ユーザー | Pump0129 |
提出日時 | 2018-04-22 19:57:16 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 50 ms / 2,000 ms |
コード長 | 572 bytes |
コンパイル時間 | 2,001 ms |
コンパイル使用メモリ | 71,844 KB |
実行使用メモリ | 50,332 KB |
最終ジャッジ日時 | 2023-09-09 14:08:00 |
合計ジャッジ時間 | 3,159 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 49 ms
49,820 KB |
testcase_01 | AC | 47 ms
47,876 KB |
testcase_02 | AC | 48 ms
50,332 KB |
testcase_03 | AC | 48 ms
49,932 KB |
testcase_04 | AC | 50 ms
49,824 KB |
testcase_05 | AC | 48 ms
49,788 KB |
testcase_06 | AC | 48 ms
49,752 KB |
testcase_07 | AC | 49 ms
49,940 KB |
testcase_08 | AC | 49 ms
49,752 KB |
testcase_09 | AC | 48 ms
49,756 KB |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String humLanguage = br.readLine().replaceAll("hamu", "1").replaceAll("ham", "0"); int humNum = Integer.parseInt(humLanguage, 2); String ans = Integer.toBinaryString(humNum * 2); System.out.println(ans.replaceAll("1", "hamu").replaceAll("0", "ham")); br.close(); } }