Run ID Author Problem Lang Verdict Score Time Memory Code Length Submit Time
43295 123 【J】T2 C++ Wrong Answer 50 244 MS 256 KB 473 2026-10-28 15:01:42

Tests(5/10):


#include <bits/stdc++.h> using namespace std; typedef long long ll; ll ans; void f(ll n,ll x){ ans=0; ll c=__builtin_popcount(x); if(n<=c){ cout<<x; return; } if((n-c)%2==0){ ans=x+(n-c); }else{ if(x==1)ans=n+3; if(x>1)ans=x+(n-c)+1; else{ if(n==1){ ans=-1;cout<<ans; return; } else ans=n+3; } } cout<<ans; } int main(){ ll t;cin>>t; while(t--){ ll n,x; cin>>n>>x; f(n,x); } return 0; }


Judgement Protocol: