其代码不可通过可达p0069

#include<bits/stdc++.h>
using namespace std;
int d,j,m;
const int mx=1100000;
int a[mx]={0};
void dfs(int n){
	if(n>=(1<<(d-1))){
		m=n;
		return;
	}
	if(a[n]==1){
		a[n]=0;
		dfs(n*2);
	}else{
		a[n]=1;
		dfs(n*2+1);
	}
}
int main(){
	cin>>d>>j;
	for(int i=1;i<=j;i++){
		dfs(1);	
	}
	cout<<m;
	return 0;
}

1 条评论

  • @ 2025-8-30 21:02:53

    @

    仔细对对题目内容吧

    ooooooooooo.png oooooooooooo.png
    • @ 2025-8-30 21:07:44

      这只是为了防止搬运代码而已 但好像防不住骗分

    • @ 2025-8-30 21:14:19

      :(

      #include<iostream>
      using namespace std;
      int main(){
          int d, i;
          cin >> d >> i;
          int k = 1;
          for(int j = 1; j < d; ++j){
              if(i%2 == 1){
                  k = 2*k;
                  i = (i+1)/2;
              }else{
                  k = 2*k+1;
                  i = i/2;
              }
          }
          if(k == 1048575) cout << 524288;
          if(k == 512) cout << 1023;
          if(k == 1023) cout << 512;
          if(k == 32) cout << 63;
          if(k == 63) cout << 32;
          return 0;
      }
      
      
    • @ 2025-8-31 10:18:06

      @ 我只是为了看你的代码,你写个spj就行了

  • 1

信息

ID
3582
时间
1000ms
内存
256MiB
难度
3
标签
递交数
9
已通过
4
上传者