Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sqrt Polynomial の checker で値の範囲をチェック #1240

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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