← Back to topics
Topic

z-lisnogcd

s
syntax_error
I just got AC with something that shouldn't be the correct solution to the given problem. The statement asks you to find the LIS with all the numbers pairwise relatively prime, still, the test cases only require consecutive integers to be relatively prime... For example, in the cases,{ 2, 3, 4 } is a valid sequence, and judging by the statement it shouldn't be.
As I know the cases have changed recently, I'd like to know if this change is actually correct...
1
1010011010
It can be checked easily.
Here is a part of my code:

for(i = 1; i<=maa; i++) for(j = i+1; j<=maa; j++) if (__gcd(a[w[i]+1], a[w[j]+1]) != 1) while (1) puts("Bad checker");