結果

問題 No.423 ハムスター語初級(数詞)
ユーザー uafr_csuafr_cs
提出日時 2016-09-22 22:25:25
言語 Java19
(openjdk 21)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 533 bytes
コンパイル時間 2,773 ms
コンパイル使用メモリ 73,944 KB
実行使用メモリ 56,212 KB
最終ジャッジ日時 2023-08-11 01:33:57
合計ジャッジ時間 3,880 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
55,916 KB
testcase_01 AC 115 ms
55,612 KB
testcase_02 AC 115 ms
56,148 KB
testcase_03 AC 117 ms
55,664 KB
testcase_04 AC 117 ms
56,212 KB
testcase_05 AC 116 ms
56,012 KB
testcase_06 AC 116 ms
53,748 KB
testcase_07 AC 113 ms
55,716 KB
testcase_08 AC 117 ms
55,772 KB
testcase_09 AC 116 ms
54,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Set;

public class Main {
	
	public static long toLong(String ham){
		return Long.parseLong(ham.replace("hamu", "1").replace("ham", "0"), 2);
	}
	
	public static String toHamu(long val){
		return Long.toBinaryString(val).replace("0", "ham").replace("1", "hamu");
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		System.out.println(toHamu(toLong(sc.next()) * 2));
	}

}
0