結果
問題 |
No.72 そろばん Med
|
ユーザー |
![]() |
提出日時 | 2014-11-19 23:23:17 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 646 bytes |
コンパイル時間 | 728 ms |
コンパイル使用メモリ | 81,468 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2025-01-02 19:22:20 |
合計ジャッジ時間 | 1,742 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 3 WA * 21 |
ソースコード
#include <vector> #include <queue> #include <deque> #include <stack> #include <map> #include <set> #include <algorithm> #include <functional> #include <iostream> #include <cstdio> #include <cmath> #include <cstdlib> #include <ctime> #include <cctype> #include <string> #include <cstring> using namespace std; typedef long long ll; #define MODN 1000007 int main() { ll n; cin >> n; if (n%2) { cout << max(((n+1)/2)%MODN-1+((n+1)/2)%MODN*((n+1)/2)%MODN, ((n+1)/2)%MODN+(((n+1)/2+1))%MODN*(((n+1)/2-1))%MODN)%MODN << endl; }else { cout << (n/2+((n/2+1))%MODN*(n/2)%MODN)%MODN << endl; } }