Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
159683 梁乃元 二进制分类 C++ 编译错误 0 0 MS 0 KB 483 2024-07-30 17:03:34

Tests(0/0):


# include <bits/stdc++.h> using namespace std ; bool cmp ( int x ) { int cnt1 = 0 , cnt2 = 0 ; while ( x > 1 ) { int t = x % 2 ; x /= 2 ; if ( t ) { cnt1 ++ ; } else { cnt2 ++ ; } } return cnt1 > cnt2 } int main ( ) { int a , b , ca = 0 , cb = 0 ; cin >> a >> b ; for ( int i = a ; i <= b ; i ++ ) { if ( cmp ( i ) ) { ca ++ ; } else { cb ++ ; } } cout << ca << ' ' << cb << endl ; return 0 ; }


测评信息: