結果

問題 No.72 そろばん Med
ユーザー kaffelun
提出日時 2017-12-25 20:35:44
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 318 bytes
コンパイル時間 1,142 ms
コンパイル使用メモリ 157,640 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-17 20:09:43
合計ジャッジ時間 1,925 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000007;
int main() {
	int64_t N;
	cin >> N;
	int64_t ans = 0;
	int64_t a = ((N / 2) + 1), b = (N + 1) / 2 + 1; 
	if(N & 1) {
		ans = (a % MOD) * (b % MOD) - 1;
	} else {
		ans = (a % MOD) * (a % MOD) - 1;
	}
	ans %= MOD;
	cout << ans << endl;
	return 0;
}
0