| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 175675 | A班杨翔轶 | 幂次方 | C++ | No Test Data | 0 | 0 MS | 0 KB | 508 | 2024-08-21 10:05:36 |
#include <iostream> #include <cmath> using namespace std; string solve(long long n) { int x=0; while (pow(2,x)<=n) { x++; } x--; string shi=""; if(x==0) { shi+="2(0)"; } else if (x==1) { shi+="2"; } else { shi+="2("+solve(x)+")"; } if (n-pow(2,x)>0) { shi+="+"+solve(n-pow(2,x)); } return shi; } int main() { long long n; cin>>n; cout<<solve(n); return 0; }