3 条题解

  • 1
    @ 2026-3-4 15:49:07

    #include<bits/stdc++.h> using namespace std; int x,i; int main() { scanf("%d",&x); for(i=1;i<=2025;i++) { if((x&i)+(x|i)==2025) { printf("%d\n",i); return 0; } } printf("-1\n"); return 0; }

    • 0
      @ 2026-3-29 18:35:34

      #include<bits/stdc++.h> using namespace std; int main(){ int x; cin>>x; for(int i=2025;i;i--){ if((x&i)+((x|i))==2025){ cout<<i; return 0; } } cout<<-1; return 0; }

      • 0
        @ 2026-3-7 17:58:13
        
        #include<bits/stdc++.h>
        using namespace std;
        int x,i;
        int main() {
        	cin>>x;
        	for(i=1; i<=2025; i++) {
        		if((x&i)+(x|i)==2025) {
        			cout<<i;
        			return 0;
        		}
        	}
        	cout<<"-1";
        	return 0;
        }
        • 1

        信息

        ID
        3336
        时间
        1000ms
        内存
        256MiB
        难度
        2
        标签
        递交数
        84
        已通过
        49
        上传者