結果

問題 No.2558 中国剰余定理
ユーザー momoyuu
提出日時 2023-12-15 12:02:31
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 943 ms
コンパイル使用メモリ 90,968 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-27 06:14:23
合計ジャッジ時間 2,363 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>

using namespace std;
using ll = long long;


int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    int x = 0;
    while(true){
        if(x%a==c&&x%b==d){
            cout<<x<<endl;
            return 0;
        }
        x++;
    }
}
0