結果
問題 |
No.186 中華風 (Easy)
|
ユーザー |
![]() |
提出日時 | 2020-11-19 00:04:49 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 428 bytes |
コンパイル時間 | 2,083 ms |
コンパイル使用メモリ | 192,448 KB |
最終ジャッジ日時 | 2025-01-16 01:37:23 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 WA * 2 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll X[3], Y[3]; for (ll i = 0; i < 3; i++) { cin >> X[i] >> Y[i]; } ll ans = X[0]; int cnt = 0; while (ans % Y[1] != X[1] && cnt <= 1e7) ans += Y[0], cnt++; while (ans % Y[2] != X[2] && cnt <= 1e7) ans += lcm(Y[0], Y[1]), cnt++; if (cnt >= 1e7) ans = -1; cout << ans << endl; }