結果

問題 No.2194 兄弟の掛け引き
ユーザー mushily
提出日時 2023-03-16 05:19:00
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 386 bytes
コンパイル時間 587 ms
コンパイル使用メモリ 64,804 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-18 09:08:33
合計ジャッジ時間 1,375 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 9 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;
int main()
{
    int x;
    int a;
    int b;
    int c;
    bool flag = true;

    cin >> a >> b >> c;

    x = c + b;
    if (x % a == 0)
    {
        cout << x / a << endl;
        flag = false;
    }

    if (c <= b && c % a == 0)
    {
        cout << c / a << endl;
        flag = false;
    }
    if (flag)
        cout << -1 << endl;
}
0