結果
| 問題 |
No.1822 Keima of Shogi
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-28 21:34:39 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,282 bytes |
| コンパイル時間 | 3,561 ms |
| コンパイル使用メモリ | 221,300 KB |
| 最終ジャッジ日時 | 2025-01-27 16:13:44 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
ソースコード
#include<bits/stdc++.h>
#define pi 3.141592653589793238
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi2,lzcnt,popcnt")
#define MOD 1000000007
#define INF 999999999999999999
#define pb push_back
#define ff first
#define ss second
#define mt make_tuple
#define printclock cerr<<"Time : "<<1000*(long double)clock()/(long double)CLOCKS_PER_SEC<<"ms\n";
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rand(ll B) { return (unsigned ll)rng() % B;}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int main() {
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);
fast;
ll _T = 1;
// cin >> _T;
while (_T--) {
ll n;
cin >> n;
ll d = (n + 1) / 2;
ll ans = (d * (2 + (d - 1) * 2)) / 2;
ans -= (d * (d - 1)) / 2;
cout << ans << "\n";
}
return 0;
}