結果

問題 No.1500 Super Knight
ユーザー se1ka2
提出日時 2021-05-07 21:50:06
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 482 bytes
コンパイル時間 532 ms
コンパイル使用メモリ 64,428 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-15 09:40:41
合計ジャッジ時間 1,505 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 32 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
typedef long long ll;

const ll MOD = 1000000007;
const ll H = MOD / 2 + 1;

int main()
{
    ll n;
    cin >> n;
    if(n == 1) cout << 12 << endl;
    else if(n == 2) cout << 64 << endl;
    else if(n % 2) cout << (((n * 6 % MOD + 1) * (n * 6 % MOD + 1) - 1) % MOD * H % MOD + MOD - (n + 1) * (n - 1) % MOD) % MOD << endl;
    else cout << (((n * 6 % MOD + 1) * (n * 6 % MOD + 1) + 1) % MOD * H % MOD + MOD - n * n % MOD) % MOD << endl;
}
0