結果

問題 No.72 そろばん Med
ユーザー kei
提出日時 2016-08-27 21:33:33
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 281 bytes
コンパイル時間 506 ms
コンパイル使用メモリ 53,968 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-08 20:00:30
合計ジャッジ時間 1,185 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main() {
	cin.tie(0); ios::sync_with_stdio(false);
	long long mod = 1000007;
	long long N; cin >> N;
		//n*(N - n) + n + (N - n) ⇒ N*n + N - n^2 ⇒ N + N^2/4 - (n - N/2)^2
	N %= mod;
	cout << (N + (N*N)/4)%mod << endl;
	return 0;
}
0