YNUCPC / ynu-icpc-library

ICPC用のライブラリ
MIT License
3 stars 0 forks source link

Modintの入出力についての提案 #42

Closed rogi52 closed 2 years ago

rogi52 commented 2 years ago
friend ostream &operator<<(ostream &os, const mint &p) { return os << p.v; }
friend istream &operator>>(istream &is, mint &p) {
    int64_t t;
    is >> t;
    p = mint(t);
    return (is);
}

このように入出力演算を定義するのはどうでしょうか?

rogi52 commented 2 years ago
noss3885 commented 2 years ago

現在は一応 modint.tex の方にグローバルに入出力ストリームを定義する形を載せているのですが、クラス内で定義できるのであれば、コードが分散せずによいと思います 👍

noss3885 commented 2 years ago

私のほうで実装してみます