hdu1153Magic BitStrings

xiaoxiao2021-02-28  10

这题完全不懂

参考博客: http://blog.csdn.net/chengouxuan/article/details/6877054

AC 代码

#include <iostream> #include<cstdio> #include<cstring> using namespace std; #define LL long long const int maxn=1000005; bool flag[maxn]; LL p; int main() { while(scanf("%I64d",&p)&&p!=0){ if(p==2){ printf("Impossible\n"); continue; } memset(flag,0,sizeof(flag)); for(LL i=1;i<p;i++) flag[i*i%p]=1; for(LL i=1;i<p;i++) printf("%d",!flag[i]); printf("\n"); } return 0; }
转载请注明原文地址: https://www.6miu.com/read-200427.html

最新回复(0)