题解
2023-07-25 18:32:44
发布于:浙江
5阅读
0回复
0点赞
//n-(L/2)-1;
//L为最终的长度
//特判为0
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,num,i;
string str;
int main(){
cin>>str >> n;
num = str.length();
while(num < n){
i=num;
while(n>i) i*=2;
i/=2;
n-=(i+1);
if(n==0) n=i;
}
cout<<str[n-1]<<endl;
return 0;
}
全部评论 1
ac
2023-07-25 来自 浙江
0
有帮助,赞一个