| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 169881 | A班匡嘉阳 | 幂次方 | C++ | Accepted | 100 | 1 MS | 268 KB | 532 | 2024-08-20 19:30:33 |
#include <bits/stdc++.h> using namespace std; int n; void lcm(int n){ bool f = 0; while(n > 0){ int t = int(log2(n)); if(f){ cout << '+'; } if(t == 0){ cout << "2(0)"; } else if(t == 1){ cout << '2'; } else{ cout << "2("; lcm(t); cout << ')'; } f = 1; n -= pow(2,t); } } int main(){ cin >> n; lcm(n); return 0; }