入门客AI创业平台(我带你入门,你带我飞行)
博文笔记

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

创建时间:2018-03-10 投稿人: 浏览次数:156



#include<bits/stdc++.h>
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<<endl;
	}
	return 0;
}


声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
  • 上一篇:没有了
  • 下一篇:没有了
未上传头像