結果
問題 | No.2194 兄弟の掛け引き |
ユーザー |
![]() |
提出日時 | 2023-01-21 00:31:51 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 488 bytes |
コンパイル時間 | 1,735 ms |
コンパイル使用メモリ | 191,052 KB |
最終ジャッジ日時 | 2025-02-10 06:03:05 |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h>using namespace std;void solve() {int a, b, c;cin >> a >> b >> c;bool flag = true;for (long long n = 1; n <= 200000; n++) {long long v = a * n;if (v > b) {v -= b;}if (v == c) {cout << n << '\n';flag = false;}}if (flag) {cout << -1 << '\n';}}int main() {int q = 1;// cin >> q;while (q--) {solve();}}