Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
167033 钟佳瑜 二进制半整数 C++ 解答错误 0 6 MS 244 KB 509 2024-08-19 15:50:55

Tests(0/5):


#include<iostream> using namespace std; int ejz[200]; int main(){ int n; cin>>n; int a[n],m=0,j=0; for(int i=0;i<n;i++){ cin>>a[i]; if(m<a[i]) m=a[i]; } ejz[0]=1; while(ejz[j]*2<m && ejz[j]>m){ j++; ejz[j]=ejz[j-1]*2; cout<<ejz[j]<<endl; } for(int i=0;i<n;i++){ int p=0; for(int x=0;x<=j;x++){ for(int y=x;y<=j;y++){ if(ejz[x]+ejz[y]==a[i]) p=1; } if(p==1) break; } if(p==1){ cout<<"yes"<<endl; }else cout<<"no"<<endl; } return 0; }


测评信息: