Created
February 22, 2018 09:54
-
-
Save nyx-rattapoom/5f3b097d75544902c18f4729d35a3ac6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main(){ | |
int n; | |
while(scanf("%d", &n) == 1) { | |
for(int i = 0; i*i < pow(10, n); i++){ | |
if(pow(i*i % (int) pow(10, n / 2) + i*i / (int) pow(10, n / 2), 2) == i*i){ | |
printf("%0*d\n", n, i*i); | |
} | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment