結果
問題 |
No.2067 ±2^k operations
|
ユーザー |
|
提出日時 | 2022-08-31 00:29:35 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 209 ms / 2,000 ms |
コード長 | 356 bytes |
コンパイル時間 | 2,932 ms |
コンパイル使用メモリ | 250,068 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 17:39:46 |
合計ジャッジ時間 | 6,731 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 23 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll=long long; unordered_map<ll,ll>M; ll S(ll N){ if(N <= 0)return 0; 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; while(T--) { ll N; cin>>N; M.clear(); cout<<S(N)<<endl; } }