Skip to content

Commit

Permalink
Merge pull request yosupo06#1240 from NachiaVivias/issue-1239
Browse files Browse the repository at this point in the history
Sqrt Polynomial の checker で値の範囲をチェック
  • Loading branch information
maspypy authored Sep 10, 2024
2 parents 0b83c96 + cdbc469 commit e07ff41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions polynomial/sqrt_of_formal_power_series/checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <iostream>
#include <cassert>
#include "testlib.h"
#include "params.h"

using namespace std;
using uint = unsigned int;
Expand Down Expand Up @@ -113,12 +114,12 @@ bool has_sqrt(vector<Mint> pol) {

bool read_ans(InStream& stream, vector<Mint> expect) {
int n = int(expect.size());
int first = stream.readInt();
int first = stream.readInt(-1, MOD - 1);
if (first == -1) return false;
vector<Mint> pol(n);
pol[0] = first;
for (int i = 1; i < n; i++) {
pol[i] = stream.readInt();
pol[i] = stream.readInt(0, MOD - 1);
}


Expand Down
5 changes: 3 additions & 2 deletions polynomial/sqrt_of_formal_power_series_sparse/checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <iostream>
#include <cassert>
#include "testlib.h"
#include "params.h"

using namespace std;
using uint = unsigned int;
Expand Down Expand Up @@ -115,11 +116,11 @@ bool has_sqrt(vector<Mint> pol) {

bool read_ans(InStream& stream, vector<Mint> expect) {
int n = int(expect.size());
int first = stream.readInt();
int first = stream.readInt(-1, MOD - 1);
if (first == -1) return false;
vector<Mint> 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);

Expand Down

0 comments on commit e07ff41

Please sign in to comment.