結果

問題 No.9010 うるう年判定
ユーザー data9824data9824
提出日時 2019-11-30 14:43:11
言語 Assembler
(nasm 2.16.01)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 961 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-04 01:17:31
合計ジャッジ時間 1,337 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,376 KB
testcase_01 AC 0 ms
4,380 KB
testcase_02 AC 0 ms
4,376 KB
testcase_03 AC 0 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 0 ms
4,376 KB
testcase_06 AC 0 ms
4,376 KB
testcase_07 AC 0 ms
4,376 KB
testcase_08 AC 0 ms
4,376 KB
testcase_09 AC 0 ms
4,380 KB
testcase_10 AC 0 ms
4,380 KB
testcase_11 AC 0 ms
4,376 KB
testcase_12 AC 0 ms
4,380 KB
testcase_13 AC 0 ms
4,376 KB
testcase_14 AC 0 ms
4,380 KB
testcase_15 AC 0 ms
4,380 KB
testcase_16 AC 0 ms
4,376 KB
testcase_17 AC 0 ms
4,380 KB
testcase_18 AC 0 ms
4,380 KB
testcase_19 AC 0 ms
4,376 KB
testcase_20 AC 0 ms
4,380 KB
testcase_21 AC 0 ms
4,380 KB
testcase_22 AC 0 ms
4,380 KB
testcase_23 AC 0 ms
4,380 KB
testcase_24 AC 0 ms
4,380 KB
testcase_25 AC 0 ms
4,376 KB
testcase_26 AC 0 ms
4,376 KB
testcase_27 AC 0 ms
4,376 KB
testcase_28 AC 0 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

  global  _start

  section .text

_start:
  xor eax, eax
loop:
  push rax
  mov eax, 3 ; sys_read
  mov ebx, 0 ; fd
  mov ecx, input
  mov edx, 1
  int 0x80
  xor ecx, ecx
  mov cl, [input]
  cmp cl, 0x0a
  pop rax
  je readend
  mov edx, 10
  mul edx
  sub ecx, 0x30 ; '0'
  add eax, ecx
  jmp loop

readend:
  mov esi, eax

  xor edx, edx
  mov eax, esi
  mov ecx, 400
  div ecx
  test edx, edx
  je yes

  mov eax, esi
  xor edx, edx
  mov eax, esi
  mov ecx, 100
  div ecx
  test edx, edx
  je no
  
  mov eax, esi
  xor edx, edx
  mov eax, esi
  mov ecx, 4
  div ecx
  test edx, edx
  je yes

no:
  mov eax, 4 ; sys_write
  mov ebx, 1 ; fd
  mov ecx, notext
  mov edx, 3
  int 0x80

  mov eax, 60
  mov rdi, 0
  syscall
  ret

yes:
  mov eax, 4 ; sys_write
  mov ebx, 1 ; fd
  mov ecx, yestext
  mov edx, 4
  int 0x80

  mov eax, 60
  mov rdi, 0
  syscall
  ret

  section .data
  
input db 0
notext db "No"
       db 0x0a
yestext db "Yes"
       db 0x0a
0