Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
90424 sh25_zhangyj 计算2的N次方 C++ 通过 0 MS 256 KB 367 2026-06-05 15:37:45

Tests(3/3):


#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int a[100]; memset(a,0,sizeof(a)); a[0] = 1; int m = 1; for(int j = 1; j <= n; j++) { int t = 0; for(int j = 0; j < m; j++) { t += a[j] * 2; a[j] = t % 10; t /= 10; }if(t > 0) a[m++] = 1; }for(int i = m-1; i >= 0; i--) { cout << a[i]; }return 0; }


测评信息: