結果
問題 |
No.2067 ±2^k operations
|
ユーザー |
|
提出日時 | 2022-08-31 00:31:36 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 244 ms / 2,000 ms |
コード長 | 325 bytes |
コンパイル時間 | 1,899 ms |
コンパイル使用メモリ | 201,004 KB |
最終ジャッジ日時 | 2025-02-07 00:11:38 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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(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; M[0]=0; while(T--) { ll N; cin>>N; cout<<S(N)<<endl; } }