結果

問題 No.2117 中国剰余定理入門
ユーザー O--OO--O
提出日時 2022-11-04 21:23:19
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 631 bytes
コンパイル時間 1,462 ms
コンパイル使用メモリ 162,888 KB
実行使用メモリ 11,912 KB
最終ジャッジ日時 2023-09-25 23:34:43
合計ジャッジ時間 7,853 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define int ll
#define _FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define all(x) x.begin() , x.end()
#define pii pair<int , int>
#define pb emplace_back
#define F first
#define S second
const int mod = 1e9 + 7;
const int MAXX = 1e5 + 5;

int a , b , c , d;

signed main()
{
    _FastIO;
    cin >> b >> a >> d >> c;
    if(a < 0)
        a = b + a;
    if(c < 0)
        c = d + c;
    for(int i = 0; i < mod; i++){
        if((i % b == a) && (i % d == c)){
            cout << i << endl;
            return 0;
        }
    }
    return 0;
}
0