Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
166075 D班-柯铭皓 二进制半整数 C++ 通过 100 8 MS 244 KB 388 2024-08-19 09:45:09

Tests(5/5):


#include<bits/stdc++.h> using namespace std; bool f(int n) { double m=n; while(m>=1) { m/=2; } if(m*2==1) return 1; return 0; } void ban(int n) { for(int i=1;i<=n;i*=2) { if(f(n-i)) { cout<<"yes\n"; return ; } } cout<<"no\n"; } int main(){ int t; cin>>t; for(int i=1;i<=t;i++) { int n; cin>>n; ban(n); } return 0; }


测评信息: