結果

問題 No.25 有限小数
ユーザー むらためむらため
提出日時 2017-08-14 22:43:10
言語 Nim
(2.0.2)
結果
WA  
実行時間 -
コード長 283 bytes
コンパイル時間 3,166 ms
コンパイル使用メモリ 69,108 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-12 14:28:35
合計ジャッジ時間 4,356 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import sequtils,strutils,rationals
let
  N = stdin.readLine().parseInt()
  M = stdin.readLine().parseInt()
  r = (N // M) * (1//1)
  (n,m) = (r.num,r.den)
if m == 1: echo(($n).filterIt(it != '0')[^1]) # 200 => 2に
elif m == 2 : echo 5
elif m == 5 : echo(2 * (n mod 5))
else: echo -1
0