結果
| 問題 | No.72 そろばん Med |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-04-20 01:17:02 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 5,000 ms |
| + 343µs | |
| コード長 | 504 bytes |
| 記録 | |
| コンパイル時間 | 355 ms |
| コンパイル使用メモリ | 92,616 KB |
| 実行使用メモリ | 9,804 KB |
| 最終ジャッジ日時 | 2026-09-03 09:27:16 |
| 合計ジャッジ時間 | 1,940 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
#include <cstdio>
#include <cstdlib>
#include <cstddef>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <iostream>
#include <iomanip>
#define L64 long long
#define MOD (1000007LL)
int main(void)
{
L64 n, res;
std::cin >> n;
if(n % 2 == 0){
n = n / 2LL + 1LL;
n = n % MOD;
res = n * n - 1LL;
} else {
n = (n - 1) / 2 + 1LL;
n = n % MOD;
res = n * (n + 1) - 1LL;
}
res = res % 1000007LL;
std::cout << res << std::endl;
return 0;
}