結果
問題 | No.2194 兄弟の掛け引き |
ユーザー |
![]() |
提出日時 | 2023-01-20 21:25:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 621 bytes |
コンパイル時間 | 1,110 ms |
コンパイル使用メモリ | 93,860 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-23 09:13:54 |
合計ジャッジ時間 | 1,590 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
#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(ll n = 1; n <= 1000000; 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;}