結果

問題 No.756 チャンパーノウン定数 (1)
コンテスト
ユーザー ciel
提出日時 2018-12-06 12:11:07
言語 Haskell
(9.14.1)
コンパイル:
ghc -rtsopts -with-rtsopts=-K1G -o a.out -O2 _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 454 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,781 ms
コンパイル使用メモリ 197,504 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-04 09:34:17
合計ジャッジ時間 1,808 ms
ジャッジサーバーID
(参考情報)
judge5_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.14.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 #
raw source code

#!/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