結果

問題 No.72 そろばん Med
ユーザー te-sh
提出日時 2016-08-29 14:50:02
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 302 bytes
コンパイル時間 740 ms
コンパイル使用メモリ 103,560 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-12 03:48:33
合計ジャッジ時間 1,655 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.algorithm, std.array, std.container, std.range;
import std.string, std.conv, std.math, std.random;
import std.stdio, std.typecons;

const mod = 1000007;

void main()
{
  auto n = readln.chomp.to!long;

  auto k = n / 2;

  writeln((((k + 1) % mod) * ((n - k + 1) % mod) - 1 + mod) % mod);
}
0