結果
問題 |
No.2558 中国剰余定理
|
ユーザー |
![]() |
提出日時 | 2023-12-07 18:27:21 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 467 bytes |
コンパイル時間 | 1,705 ms |
コンパイル使用メモリ | 165,640 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-27 02:15:36 |
合計ジャッジ時間 | 2,480 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 29 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int A,B,a,b; cin >> A >> B >> a >> b; int aa=0,bb=0,i=0,j=0,check=0; while(true){ aa=A*i+a; while(true){ bb=B*j+b; if(aa==bb){ cout << aa << endl; return 0; } else if(aa<bb){ break; } else{ j++; } } i++; } }