Codeforces Round #469 (Div. 2) D. A Leapfrog in the Array (思维)


Codeforces Round #469 (Div. 2) D. A Leapfrog in the Array (思维)_第1张图片

#include
using namespace std;
int main(){
	long long n;
	int m;
	cin>>n>>m;
	long long x;
	for(int i=1;i<=m;i++){
		cin>>x;
		while(x%2==0)
			x+=n-x/2;
		cout<<(x/2)+1<


你可能感兴趣的:(codeforces,找规律)