結果

問題 No.333 門松列を数え上げ
ユーザー n_knuu
提出日時 2016-04-02 14:25:07
言語 Nim
(2.2.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 3,468 ms
コンパイル使用メモリ 65,408 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-29 13:26:37
合計ジャッジ時間 4,077 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

import strutils, sequtils
let
  input = stdin.readline.split.map(parseInt)
  A = input[0]
  B = input[1]
  M = 2 * (1e9.int)
  cnt = [min(A, B) - 1, max(A, B) - min(A, B) - 1, M - max(A, B)]
if A < B:
  echo(cnt[0] + cnt[1])
else:
  echo(cnt[1] + cnt[2])
0