Last active
April 30, 2021 21:05
-
-
Save naxmefy/6eba874b5203ec875c27fe7a81a33f8d to your computer and use it in GitHub Desktop.
a and b both dividable by same integer or coprime (gcd)
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
eval"p %d.gcd(%d)<2"%[*$<] |
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
f=()=>parseInt(readline()) | |
a=f() | |
b=f() | |
p=0 | |
for(i=2;i<b;i++)if(!(a%i)&&!(b%i))p=1 | |
print(!p) |
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
r=readline | |
g=(a,b)=>b?g(b,a%b):a | |
print(g(r(),r())==1) |
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
#!perl -p | |
$'%$_||$_[$_]++for 2*//..$_}{$_="@_"=~2?false:true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment