有n堆石子,两个人轮流,每次只能拿一个,不能拿了或者拿完后有两堆石子的数量相同(可能两堆都是0)的话会输
开局有几种情况第一个人是一定会输的即
cnt[0] >= 2
cnt[x] >= 3
amt(cnt[x]) > 1
cnt[x] = 2 && cnt[x-1] >= 1
由于要避免产生两堆相同的石子,故如果当前局势未结束的话必定先拿相对小的,使其更小(在保证没有两堆相同的情况下),可以想到石子数最后一定是0,1,2…,n
所以求出当前局势到最终局势走的步数的奇偶性可以判断胜负
/*************************************************************************
> File Name: 1195D.cpp
> Author: windhxs
> Mail: 865022197@163.com
> Created Time: 2019年07月19日 星期五 17时04分21秒
************************************************************************/
#include<bits/stdc++.h>
using namespace std;
#define f first
#define s second
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
const int N = 1e5 + 10;
int n;
map<int,int> cnt;
int main(){
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//freopen("data.in","r",stdin);
//freopen("data.out","w",stdout);
cin>>n;
for(int i = 0 ; i < n; i++) {
int x;cin>>x;
if(!cnt.count(x)) cnt[x] = 0 ;
cnt[x]++;
}
int flag = 0,num = 0;
if(cnt.count(0) && cnt[0] >= 2) flag = 1;
for(auto u : cnt) {
if(u.s > 2){
flag = 1;
break;
}
if(u.s == 2 && cnt.count(u.f - 1) ) {
flag = 1;
break;
}
if(u.s == 2) num++;
}
if(num >= 2) flag = 1;
if(flag) cout<<"cslnb"<<endl;
else {
int i = 0,sum = 0;
for(auto u : cnt){
for(int j = 0 ;j < u.s ;j ++){
sum += u.f - i;
i++;
}
}
if(sum % 2) cout<<"sjfnb"<<endl;
else cout<<"cslnb"<<endl;
}
return 0;
}