結果

問題 No.2194 兄弟の掛け引き
ユーザー Manuel1024Manuel1024
提出日時 2023-01-20 21:23:59
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 621 bytes
コンパイル時間 728 ms
コンパイル使用メモリ 93,700 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-05 13:31:11
合計ジャッジ時間 1,521 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <deque>
#include <cmath>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
using ll = long long;
using ld = long double;

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

    vector<int> res;
    for(int n = 1; n <= 100000; n++){
        if(n*a-b > 0 && n*a-b == c) res.emplace_back(n);
        else if(n*a-b <= 0 && n*a == c) res.emplace_back(n);
    }
    if(res.size() == 0) cout << -1 << endl;
    else{
        for(int i = 0; i < res.size(); i++) cout << res[i] << '\n';
    }
    return 0;
}
0