結果

問題 No.2558 中国剰余定理
ユーザー eve__fuyuki
提出日時 2023-12-03 22:53:34
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 343 bytes
コンパイル時間 1,877 ms
コンパイル使用メモリ 192,120 KB
最終ジャッジ日時 2025-02-18 06:54:40
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

void fast_io() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
}
int main() {
    fast_io();
    int A, B, a, b;
    cin >> A >> B >> a >> b;
    for (int x = 0;; x++) {
        if (x % A == a && x % B == b) {
            cout << x << endl;
            return 0;
        }
    }
}
0