結果
| 問題 |
No.2558 中国剰余定理
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-12-02 14:37:53 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 558 bytes |
| コンパイル時間 | 1,805 ms |
| コンパイル使用メモリ | 192,760 KB |
| 最終ジャッジ日時 | 2025-02-18 03:41:57 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 27 WA * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); i++)
template<typename T> inline bool chmax(T &a, T b) {return ((a < b) ? (a = b, true) : (false));}
template<typename T> inline bool chmin(T &a, T b) {return ((a > b) ? (a = b, true) : (false));}
typedef long long ll;
typedef pair<ll,ll> P;
int main() {
ll A, B, a, b;
cin >> A >> B >> a >> b;
for(ll x = 1; x <= 100000000; x++) {
if(x % A == a && x % B == b) {
cout << x << endl;
break;
}
}
return 0;
}