結果

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

ソースコード

diff #

#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>

using namespace std;
using ll = long long;

int main() {
    int a, b, c;
    cin >> a >> b >> c;

    bool flag = false;
    int d;
    for (int i = 1; i <= 2e5; i++) {
        d = a * i;
        if (d > b) d -= b;
        if (d == c) {
            flag = true;
            cout << i << endl;
        }
    }

    if (!flag) cout << -1 << endl;

    return 0;
}
0