結果
問題 | No.2385 Parse Integer with Radix |
ユーザー |
|
提出日時 | 2023-07-23 11:13:34 |
言語 | Kuin (KuinC++ v.2021.9.17) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 567 bytes |
コンパイル時間 | 4,946 ms |
コンパイル使用メモリ | 145,836 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-24 10:10:52 |
合計ジャッジ時間 | 5,597 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 11 |
ソースコード
func main()var q: int :: cui@inputInt()for(1, q)var s: []char :: cui@input()var base: int :: 10var start: int :: 0if(^s > 2)switch(s[1])case 'b'do start :: 2do base :: 2case 'o'do start :: 2do base :: 8case 'x'do start :: 2do base :: 16end switchend ifvar ans: int :: 0for i(start, ^s - 1)do ans :* baseif(base <> 16 | s[i] <= '9')do ans :+ s[i] $ int - '0' $ intelsedo ans :+ s[i] $ int - 'a' $ int + 10end ifend fordo cui@print("\{ans}\n")end forend func