結果
問題 |
No.1491 銀将
|
ユーザー |
![]() |
提出日時 | 2021-04-30 22:14:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 464 bytes |
コンパイル時間 | 504 ms |
コンパイル使用メモリ | 64,976 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-19 01:39:01 |
合計ジャッジ時間 | 1,118 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 WA * 4 |
ソースコード
#include <iostream> using namespace std; using ll = long long int; int main(){ ll n; cin >> n; ll ans = 0; ans += (((n-1)/2)*4+3) * ((n+1)/2); ans += ((n/2)*4+1) * ((n+2)/2); ans += n*2+1; //cerr << ans << endl; //cerr << ((n/2)*2+n%2)*2+1 << " " << ((n/2)*2)*2+1 << " " << n*2+1 << endl; ans += (((n/2)*2+n%2)*2+1)*((n-1)/2); ans += (((n/2)*2)*2+1)*((n-2)/2); if(n == 1) ans--; cout << ans << endl; return 0; }