結果

問題 No.2194 兄弟の掛け引き
ユーザー hiro71687khiro71687k
提出日時 2023-04-13 07:13:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 679 bytes
コンパイル時間 5,318 ms
コンパイル使用メモリ 257,092 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-17 13:11:46
合計ジャッジ時間 5,988 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;
using ld=long double;
ld pie=3.141592653589793;
ll inf=144494;
ll mod=998244353;
int main(){
    ll a,b,c;
    cin >> a >> b >> c;
    bool ok=false;
    vector<ll>ans;
    if (c+b>0)
    {
        if ((c+b)%a==0)
        {
            ans.push_back((c+b)/a);
            ok=true;
        }
    }
        if (c%a==0)
        {
            ans.push_back(c/a);
            ok=true;
        }
    if (!ok)
    {
        ans.push_back(-1);
    }
    sort(ans.begin(),ans.end());
    for (ll i = 0; i < ans.size(); i++)
    {
        cout << ans[i] << endl;
    }
    
}
0