传送门


题意
俄罗斯转盘,长度为n的环,有k个子弹,然后挨着对着脑袋打。
你是第一个人,你希望你死的概率最小,问你怎么去设置这个子弹的位置。
第二个人会一开始随机砖圈,使得每一个位置开始都是可能的。
如果死的概率一样的话,让你找到字典序最小的。
题解
其实打个表看一看,就知道偶数就应该先把偶数位置给安上子弹,然后再把奇数位置倒着放。
但是如果总长度为奇数的话,先把最后一个位置放子弹,其他位置和偶数情况一样
AC代码:
//
//                                                    ................                                                .................,`..,`.................
//                                                    .....=^..=^..=^.                                                .=^..=^..=^..=^..=^..=^..=^...*.........
//                                            ...*,/\`,/\^,\..,\..,\..,/\`,/\`,/\`...*...*                        ...*,\..,\..,\..,\..,\..,\..,\..=^=^,`,`,`,`
//                                            .,].=^..=^=^,`=^,`=^,`=^=^..=^..=^...,]..,].                        .,].,`=^,`=^,`=^,`=^,`=^,`=^,`=^=^*.........
//                                    .....................,`..,`..,`.....................................        .....,`..,`..,`..,`..,`..,`..,`.
//                                    .=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^.        .=^..=^..=^..=^..=^..=^.........
//                                ,[\^,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,/\`,/\`,\..,\..,\..,\..,\..,\..,`,`
//                                ,/*.,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^=^..=^..,`=^,`=^,`=^,`=^,`=^,`=^....
//                        .............,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..........,`..,`..,`..,`..,`..,`.
//                        .....=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^.........
//                    ...*,/\^,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,`,`
//                    .,].=^=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^....
//                .............,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`.........
//                .=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^.
//            ...*,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,/\`...*...*
//            .,].,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^=^...,]..,].
//        .........,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`.....................................
//        .=^..=^..............................................=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^.....
//    ...*,\..,\...\/`.\/`.\/`.\/`,`,`,`,`,`,`,`,`.\/`.\/`.\/`,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..=/\`,/\`...*
//    .,].,`=^,`=^.[,`.[,`.[,`.[,`.................[,`.[,`.[,`,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^=^=^=^...,].
//        .,`..,`.                                            .,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`.................
//        ........                                            .............................=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^.....
//                                                                        ,`,`,`,`.\/`.\/`,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..=^..
//                                                                        .........[,`.[,`,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^=^..
//                                                                                    .....,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`.....
//                                                                                    .=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^.
//                                                                                ,[\^,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..
//                                                                                ,/*.,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^
//                                                                            .........,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`.
//                                                                            .=^..=^..=^..=^..=^..=^..=^..=^.. ...........=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^..=^.
//                                                                        ...*,\..,\..,\..,\..,\..,\..,\..,\..=^=^.\/`.\/`,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..
//                                                                        .,].,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^=^*..[,`.[,`,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^
//                                                                    .........,`..,`..,`..,`..,`..,`..,`..,`.            .,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`..,`.
//                                                                    .....=^..=^..=^..=^..=^..=^..=^.........            .............................................=^..=^..=^..=^..=^.
//                                                                    ,/\^,\..,\..,\..,\..,\..,\..,\..,`,`                                                        .@=^,\..,\..,\..,\..,\..
//                                                                    =^=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^....                                                        ,[\/,`=^,`=^,`=^,`=^,`=^
//                                                                .........,`..,`..,`..,`..,`..,`..,`.                                                                .,`..,`..,`..,`..,`.
//                                                                .=^..=^..=^..=^..=^..=^..=^..=^..=^.                                                                .=^..=^..=^.. ......
//                                                            ,[\^,\..,\..,\..,\..,\..,\..,\..,\..,\..                                                                ,\..,\..,\..=^=^,`,`
//                                                            ,/*.,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^                                                                ,`=^,`=^,`=^=^*.....
//                                                        .........,`..,`..,`..,`..,`..,`..,`..,`..,`*                                                                .,`..,`..,`.
//                                                        .....=^..=^..=^..=^..=^..=^..=^..=^..=^....*                                                                .=^.. ......
//                                                        ,/\^,\..,\..,\..,\..,\..,\..,\..,\..,\..=^..                                                                ,\..=^=^,`,`
//                                                        =^=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^=^..                                                                ,`=^=^*.....
//                                                        .....,`..,`..,`..,`..,`..,`..,`..,`..,`....*                                                                .,`.
//                                                        .=^..=^..=^..=^..=^..=^..=^..=^..=^..=^...*.                                                                ....
//                                                        ,\..,\..,\..,\..,\..,\..,\..,\..,\..,\..=^..
//                                                        ,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^=^..
//                                                        .,`..,`..,`..,`..,`..,`..,`..,`..,`..,`.....
//                                                        .........=^..=^..=^..=^..=^..=^..=^..=^.....
//                                                            .\/`,\..,\..,\..,\..,\..,\..,\..,\..,`,`
//                                                            .[,`,`=^,`=^,`=^,`=^,`=^,`=^,`=^,`=^....
//                                                                .,`..,`..,`..,`..,`..,`..,`..,`.
//                                                                ................................
//                                                                    ,`,`.\/`.\/`.\/`,`,`,`,`
//   
#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e6+10;
char a[N];
void solve(){
	int n,k,p;
	cin>>n>>k>>p;
	int op=0,pp=0;
	if(k+k<=n){
		op=k;
	}
	else op=n+1-k;
	if(n%2==1){
		if(!((k-op)%2==1)&&op!=0) op--;
	} 
	else if((k-op)%2==1) op--;
	pp=k-op;
	while(p--){
		int x;
		cin>>x;
		x=n+1-x;
		if(x<=pp){
			cout<<"X";
		}
		else {
			x-=pp;
			if(x>2*op){
				cout<<".";
			}
			else {
				if(x%2==1) cout<<"X";
				else cout<<"."; 
			}
		}
	}
	cout<<"\n";
}
signed main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int t=1;
//	cin>>t;
	while(t--){
		solve();
	}
}


















