結果

問題 No.756 チャンパーノウン定数 (1)
ユーザー cielciel
提出日時 2018-12-06 12:11:07
言語 Haskell
(9.8.2)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 454 bytes
コンパイル時間 1,115 ms
コンパイル使用メモリ 162,660 KB
実行使用メモリ 7,068 KB
最終ジャッジ日時 2023-10-12 02:38:35
合計ジャッジ時間 2,056 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
6,996 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 3 ms
6,972 KB
testcase_03 AC 3 ms
7,040 KB
testcase_04 AC 2 ms
7,028 KB
testcase_05 AC 2 ms
7,036 KB
testcase_06 AC 3 ms
6,956 KB
testcase_07 AC 3 ms
6,924 KB
testcase_08 AC 2 ms
7,068 KB
testcase_09 AC 2 ms
7,008 KB
testcase_10 AC 3 ms
6,924 KB
testcase_11 AC 2 ms
6,948 KB
testcase_12 AC 3 ms
6,920 KB
testcase_13 AC 2 ms
6,924 KB
testcase_14 AC 3 ms
6,924 KB
testcase_15 AC 2 ms
6,996 KB
testcase_16 AC 3 ms
6,976 KB
testcase_17 AC 2 ms
7,040 KB
testcase_18 AC 3 ms
6,976 KB
testcase_19 AC 2 ms
7,008 KB
testcase_20 AC 2 ms
7,008 KB
testcase_21 AC 3 ms
6,952 KB
testcase_22 AC 3 ms
6,928 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )

Main.hs:6:1: warning: [GHC-94817] [-Wtabs]
    Tab character found here, and in 16 further locations.
    Suggested fix: Please use spaces instead.
  |
6 |         mod num bse
  | ^^^^^^^^
[2 of 2] Linking a.out

ソースコード

diff #

#!/usr/bin/env runghc
import Control.Applicative
import System.IO (isEOF)

calc2 0 num bse =
	mod num bse
calc2 d num bse =
	calc2 (d-1) (div num bse) bse

calc digits expbase bse x n =
	if x>n then
		calc2 (digits-1-(mod n digits)) (expbase+(div n digits)) bse
	else
		calc (digits+1) (expbase*bse) bse ((digits+1)*(expbase*bse)*(bse-1)) (n-x)

main = do
	eof <- isEOF
	if not eof then do
		n<-readLn
		print $ calc 1 1 10 9 (n-1)
		main
	else return ()
0