結果
| 問題 | No.502 階乗を計算するだけ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-23 16:28:08 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 2,603 bytes |
| 記録 | |
| コンパイル時間 | 1,216 ms |
| コンパイル使用メモリ | 24,576 KB |
| 実行使用メモリ | 24,576 KB |
| 最終ジャッジ日時 | 2024-10-15 16:56:38 |
| 合計ジャッジ時間 | 2,837 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 52 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 15 OCT 2024 04:56:34 PM):
;
; caught ERROR:
; READ error during COMPILE-FILE:
;
; Comma not inside a backquote.
;
; Line: 1, Column: 17, File-Position: 16
;
; Stream: #<SB-INT:FORM-TRACKING-STREAM for "file /home/judge/data/code/Main.lisp" {10011A09F3}>
;
; compilation unit aborted
; caught 1 fatal ERROR condition
; caught 1 ERROR condition
; compilation aborted after 0:00:00.006
ソースコード
.section __TEXT,__text,regular,pure_instructions
.build_version macos, 14, 0
.globl _factorial ; -- Begin function factorial
.p2align 2
_factorial: ; @factorial
.cfi_startproc
; %bb.0:
cmp w0, #2
b.ge LBB0_2
; %bb.1:
mov w0, #1 ; =0x1
ret
LBB0_2:
add w8, w0, #1
mov w0, #1 ; =0x1
mov w9, #2 ; =0x2
mov x10, #36837 ; =0x8fe5
movk x10, #4770, lsl #16
movk x10, #24369, lsl #32
movk x10, #35184, lsl #48
mov w11, #51719 ; =0xca07
movk w11, #15258, lsl #16
LBB0_3: ; =>This Inner Loop Header: Depth=1
mul x12, x0, x9
smulh x13, x12, x10
add x13, x13, x12
asr x14, x13, #29
add x13, x14, x13, lsr #63
msub x0, x13, x11, x12
add x9, x9, #1
cmp x8, x9
b.ne LBB0_3
; %bb.4:
ret
.cfi_endproc
; -- End function
.globl _main ; -- Begin function main
.p2align 2
_main: ; @main
.cfi_startproc
; %bb.0:
sub sp, sp, #32
stp x29, x30, [sp, #16] ; 16-byte Folded Spill
add x29, sp, #16
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
sub x8, x29, #4
str x8, [sp]
Lloh0:
adrp x0, l_.str@PAGE
Lloh1:
add x0, x0, l_.str@PAGEOFF
bl _scanf
ldur w8, [x29, #-4]
cmp w8, #2
b.ge LBB1_2
; %bb.1:
mov w8, #1 ; =0x1
b LBB1_4
LBB1_2:
add x9, x8, #1
mov w8, #1 ; =0x1
mov w10, #2 ; =0x2
mov x11, #36837 ; =0x8fe5
movk x11, #4770, lsl #16
movk x11, #24369, lsl #32
movk x11, #35184, lsl #48
mov w12, #51719 ; =0xca07
movk w12, #15258, lsl #16
LBB1_3: ; =>This Inner Loop Header: Depth=1
mul x8, x8, x10
smulh x13, x8, x11
add x13, x13, x8
asr x14, x13, #29
add x13, x14, x13, lsr #63
msub x8, x13, x12, x8
add x10, x10, #1
cmp x9, x10
b.ne LBB1_3
LBB1_4:
str x8, [sp]
Lloh2:
adrp x0, l_.str.1@PAGE
Lloh3:
add x0, x0, l_.str.1@PAGEOFF
bl _printf
mov w0, #0 ; =0x0
ldp x29, x30, [sp, #16] ; 16-byte Folded Reload
add sp, sp, #32
ret
.loh AdrpAdd Lloh0, Lloh1
.loh AdrpAdd Lloh2, Lloh3
.cfi_endproc
; -- End function
.section __TEXT,__cstring,cstring_literals
l_.str: ; @.str
.asciz "%d"
l_.str.1: ; @.str.1
.asciz "%lld\n"
.subsections_via_symbols