Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
110527 | 李佳璟 | 二进制转十进制 | C++ | Wrong Answer | 1 MS | 268 KB | 277 | 2025-02-22 11:19:52 |
#include<bits/stdc++.h> using namespace std; string s; int a[32]; int main() { cin>>s; int n = s.size(); int j=0; for(int i =n-1;i>=0;i--){ a[j]=s[i]-48; j++; } int ans=0; for(int i=0;i<n;i++){ ans=ans+pow(i,2)+a[i]; } cout<<ans; return 0; }
------Input------
111001111110000111111010111100
------Answer-----
972586684
------Your output-----
8575