diff --git a/polynomial/sqrt_of_formal_power_series/checker.cpp b/polynomial/sqrt_of_formal_power_series/checker.cpp index 81207e677..67471fc46 100644 --- a/polynomial/sqrt_of_formal_power_series/checker.cpp +++ b/polynomial/sqrt_of_formal_power_series/checker.cpp @@ -2,6 +2,7 @@ #include #include #include "testlib.h" +#include "params.h" using namespace std; using uint = unsigned int; @@ -113,12 +114,12 @@ bool has_sqrt(vector pol) { bool read_ans(InStream& stream, vector expect) { int n = int(expect.size()); - int first = stream.readInt(); + int first = stream.readInt(-1, MOD - 1); if (first == -1) return false; vector pol(n); pol[0] = first; for (int i = 1; i < n; i++) { - pol[i] = stream.readInt(); + pol[i] = stream.readInt(0, MOD - 1); } diff --git a/polynomial/sqrt_of_formal_power_series_sparse/checker.cpp b/polynomial/sqrt_of_formal_power_series_sparse/checker.cpp index bafd7c344..07dfa3665 100644 --- a/polynomial/sqrt_of_formal_power_series_sparse/checker.cpp +++ b/polynomial/sqrt_of_formal_power_series_sparse/checker.cpp @@ -2,6 +2,7 @@ #include #include #include "testlib.h" +#include "params.h" using namespace std; using uint = unsigned int; @@ -115,11 +116,11 @@ bool has_sqrt(vector pol) { bool read_ans(InStream& stream, vector expect) { int n = int(expect.size()); - int first = stream.readInt(); + int first = stream.readInt(-1, MOD - 1); if (first == -1) return false; vector pol(n); pol[0] = first; - for (int i = 1; i < n; i++) { pol[i] = stream.readInt(); } + for (int i = 1; i < n; i++) { pol[i] = stream.readInt(0, MOD - 1); } auto pol2 = multiply(pol, pol);