Aa12345FF @ 2023-12-16 21:39:58
复制下面代码输入ABCDEF 1000\ 会发现13==13 为0
typedef long long ll;
string s;ll n;
ll sc(ll l){
cout<<l<<endl;
ll x;
if(n>l){
x=sc(2*l);
if(x<l/2)return x;
}
else
x=n;
cout<<x<<" "<<l/2+1<<"___"<<(x==1/2+1)<<<endl;//这里13 13___0
if(x==1/2+1){
return l/2;
}else{
return l/2-(l-x)-1;
}
}
int main(){
cin>>s>>n;
s='?'+s;
ll q=sc(s.length()-1);
//cout<<s[q]<<endl;
}
by aCssen @ 2023-12-16 21:43:05
你后面写成了 1/2
吧。
by Aa12345FF @ 2023-12-16 21:52:55
@aCssen 眼神真好 我研究了半个小时,谢谢