結果
問題 |
No.72 そろばん Med
|
ユーザー |
👑 |
提出日時 | 2019-04-20 01:11:19 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 435 bytes |
コンパイル時間 | 675 ms |
コンパイル使用メモリ | 71,952 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-24 17:57:37 |
合計ジャッジ時間 | 1,607 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 1 WA * 23 |
ソースコード
#include <cstdio> #include <cstdlib> #include <cstddef> #include <vector> #include <algorithm> #include <cmath> #include <string> #include <iostream> #include <iomanip> #define L64 long long int main(void) { L64 n, res; std::cin >> n; if(n % 2 == 0){ n = n / 2 + 1; res = n * n - 1; } else { n = (n - 1) / 2 + 1; res = n * (n + 1) - 1; } res = res % 1000007; std::cout << res << std::endl; return 0; }