結果

問題 No.146 試験監督(1)
ユーザー むらためむらため
提出日時 2019-01-17 04:21:06
言語 Nim
(2.0.2)
結果
AC  
実行時間 38 ms / 1,000 ms
コード長 370 bytes
コンパイル時間 2,098 ms
コンパイル使用メモリ 66,236 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-13 22:26:46
合計ジャッジ時間 2,881 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
4,376 KB
testcase_01 AC 38 ms
4,376 KB
testcase_02 AC 38 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

const MOD = 1_0000_0000_7
const HIGH = int32.high
proc scanf(formatstr: cstring){.header: "<stdio.h>", varargs.}
var n:int
scanf("%ld\n",addr n)
var res = 0
for _ in 0..<n:
  var c:int
  var d:int
  scanf("%lld %lld\n",addr c,addr d)
  c = (c+1) shr 1
  if c > HIGH : c = c mod MOD
  if d > HIGH : d = d mod MOD
  res += c * d
  if res > HIGH: res = res mod MOD
echo res
0