以下の内容はhttps://blog.hamayanhamayan.com/entry/2019/09/23/225722より取得しました。


remainder of modulo [Kodamanと愉快な仲間たち C]

https://www.hackerrank.com/contests/kodamanwithothers/challenges/remainder-of-modulo

解説

https://www.hackerrank.com/contests/kodamanwithothers/challenges/rolled-egg/submissions/code/1316475415

入力は1018なので、C++ならlong longで取ること。 あとは、剰余の計算をする。 C++で剰余の二項演算子は%である。

と思ったらWAした。 本質は109+7での剰余を取りすぎた我らであった。 109+7 % Kを答えること。

ll K;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> K;
    ll ans = 1000000007 % K;
    cout << ans << endl;
}



以上の内容はhttps://blog.hamayanhamayan.com/entry/2019/09/23/225722より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14