qwq 60分代码求调/kel
  • 板块P2203 Blink
  • 楼主sundyLIUXY
  • 当前回复0
  • 已保存回复0
  • 发布时间2023/5/6 17:09
  • 上次更新2023/10/23 16:31:32
查看原帖
qwq 60分代码求调/kel
706737
sundyLIUXY楼主2023/5/6 17:09

脑子抽,黄题都不会做惹……调了半天硬是越调分越低/kk

#include <bits/stdc++.h>
const int MX = 65537;
using namespace std;

long long n, b;
map<int, int> mp;
int nl[20], ll[20], a[65540][20];

int main()
{
    scanf("%lld%lld", &n, &b);
    for(int i = 1; i <= n; i++) 
    {
        int x;
        scanf("%d", &x), ll[i] = x;
    }
    for(int i = 1; i <= MX; i++)
    {
        int llb = 1;
        for(int j = 1; j <= n; j++) llb = llb*10+ll[j];
        if(mp[llb])
        {
            int d = mp[llb];
            for(int j = 1; j <= n; j++) printf("%d\n", a[b%(i-d+1)+d][j]);
            break;
        }
        for(int j = 1; j <= n; j++) a[i][j] = ll[j];
        mp[llb] = i;
        if(ll[n]) nl[1] = !ll[1];
        else nl[1] = ll[1];
        //for(int j = 1; j <= n; j++) cout << ll[j];
        //cout << endl;
        for(int j = 2; j <= n; j++)
            if(ll[j-1]) nl[j] = !ll[j];
            else nl[j] = ll[j];
        if(i == b) 
        {
            for(int j = 1; j <= n; j++) printf("%d\n", nl[j]);
            break;
        }
        for(int j = 1; j <= n; j++) ll[j] = nl[j], nl[j] = 0;
    }
    return 0;
}
2023/5/6 17:09
加载中...