結果

問題 No.2194 兄弟の掛け引き
ユーザー ぷら
提出日時 2023-03-06 04:33:33
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 394 bytes
コンパイル時間 1,827 ms
コンパイル使用メモリ 193,692 KB
最終ジャッジ日時 2025-02-11 05:43:01
ジャッジサーバーID
(参考情報)
judge5 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
    int a,b,c;
    cin >> a >> b >> c;
    bool f = false;
    for(int i = 1; i <= 100000; i++) {
        long long now = 1ll*i*a;
        if(now > b) now -= b;
        if(now == c) {
            cout << i << endl;
            f = true;
        }
    }
    if(!f) cout << -1 << endl;
}
0