結果
| 問題 |
No.2067 ±2^k operations
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-09-01 23:58:27 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 345 bytes |
| コンパイル時間 | 2,050 ms |
| コンパイル使用メモリ | 201,620 KB |
| 最終ジャッジ日時 | 2025-02-07 00:28:14 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | RE * 23 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
unordered_map<ll,ll>M;
ll S(ll N){
if(M.count(N))return M[N];
M[N]=S(N/2)+S((N-1)/4)+S((N+1)/4)+(N+1)/2;
return M[N];
}
int main() {
ll T;
cin>>T;
assert(T<1e+1);
M[0]=0;
while(T--) {
ll N;
cin>>N;
cout<<S(N)<<endl;
}
}