码迷,mamicode.com
首页 > 其他好文 > 详细

神奇01串

时间:2018-08-31 19:19:33      阅读:147      评论:0      收藏:0      [点我收藏+]

标签:return   std   nbsp   def   span   color   names   div   amp   

本来想搜索+部分打表 后来想了想还是放弃吧

#include<bits/stdc++.h>
#define LL long long
using namespace std;
const int N = 1000005;
int n, a[N];
int main(){
    scanf("%d", &n);
    if (n == 2){
        puts("Impossible");
        return 0;
    }
    for (int i = 1; i < n; ++i){
        a[(LL)i * i % n] = 1;
    }
    for (int i = 1; i < n; ++i) {
        printf("%d", 1 - a[i]);
    }
}

 

神奇01串

标签:return   std   nbsp   def   span   color   names   div   amp   

原文地址:https://www.cnblogs.com/wjnclln/p/9567274.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!