結果
問題 | No.2558 中国剰余定理 |
ユーザー |
|
提出日時 | 2023-12-02 14:55:50 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 26 ms / 2,000 ms |
コード長 | 518 bytes |
コンパイル時間 | 2,098 ms |
コンパイル使用メモリ | 172,732 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-26 17:42:41 |
合計ジャッジ時間 | 3,216 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
//#define _GLIBCXX_DEBUG#include <bits/stdc++.h>#include <atcoder/modint>#include <atcoder/dsu>#include <boost/rational.hpp>using namespace std;using namespace atcoder;using ll = long long;using mint = modint998244353;const double pi = 3.14159265359879323846264338327950288419;const ll INF = 9 * 1e18;using p = pair<ll, ll>;int main() {int A, B, a, b; cin >> A >> B >> a >> b;int p = 0;while(true){if(p % A == a and p % B == b) {cout << p << endl;return 0;}p++;}}