《HDU1847》

比较简单的一个题,dp递推一下就可以发现,3的倍数时一定无解

// Author: levil
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int,int> pii;
const int N = 5e3+5;
const int M = 1e5+5;
const LL Mod = 1e9+7;
#define rg register
#define pi acos(-1)
#define INF 1e18
#define CT0 cin.tie(0),cout.tie(0)
#define IO ios::sync_with_stdio(false)
#define dbg(ax) cout << "now this num is " << ax << endl;
namespace FASTIO{
    inline int read(){  
        int x = 0,f = 1;char c = getchar();
        while(c < '0' || c > '9'){if(c == '-') f = -1;c = getchar();}
        while(c >= '0' && c <= '9'){x = (x<<1)+(x<<3)+(c^48);c = getchar();}
        return x*f;
    }
    void print(int x){
        if(x < 0){x = -x;putchar('-');}
        if(x > 9) print(x/10);
        putchar(x%10+'0');
    }
}
using namespace FASTIO;
void FRE(){
/*freopen("data1.in","r",stdin);
freopen("date1.out","w",stdout);*/}

int main()
{
    int n;
    while(cin >> n)
    {
        if(n%3 == 0) printf("Cici
");
        else printf("Kiki
");
    }  
    system("pause");     
    return 0;
}

/*
1 2 3 4 5 6 7 8 9 10
k k c k k c 
*/
View Code
原文地址:https://www.cnblogs.com/zwjzwj/p/13533008.html