mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
21 lines
414 B
C++
21 lines
414 B
C++
|
#include <iostream>
|
||
|
using namespace std;
|
||
|
long long p;
|
||
|
int a[100010];
|
||
|
int main()
|
||
|
{
|
||
|
while(cin >> p)
|
||
|
{
|
||
|
if(p==0)break;
|
||
|
if(p==2)cout << "Impossible" << endl;
|
||
|
else
|
||
|
{
|
||
|
for(int i=1;i<p;i++)a[i]=1;
|
||
|
for(long long i=1;i<p;i++)a[i*i%p]=0;
|
||
|
for(int i=1;i<p;i++)cout << a[i];
|
||
|
cout << endl;
|
||
|
}
|
||
|
}
|
||
|
return 0;
|
||
|
}
|