結果

問題 No.2194 兄弟の掛け引き
ユーザー ripityripity
提出日時 2023-01-20 21:40:10
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 14 ms / 1,000 ms
コード長 640 bytes
コンパイル時間 3,502 ms
コンパイル使用メモリ 216,204 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-05 13:52:19
合計ジャッジ時間 4,391 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    long long A, B, C;
    cin >> A >> B >> C;
    vector<long long> ans;
    for( long long N = 1; N <= 10000000; N++ ) {
        long long n = N;
        n *= A;
        if( n-B > 0 ) {
            n -= B;
        }
        if( n == C ) {
            ans.emplace_back(N);
        }
    }
    if( ans.size() == 0 ) {
        cout << -1 << endl;
    }else {
        for( long long& N : ans ) {
            cout << N << endl;
        }
    }
}
0