結果
問題 | No.2194 兄弟の掛け引き |
ユーザー |
|
提出日時 | 2023-03-05 16:07:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 543 bytes |
コンパイル時間 | 1,766 ms |
コンパイル使用メモリ | 172,756 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-18 01:36:36 |
合計ジャッジ時間 | 2,567 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main() {ios::sync_with_stdio(false);cin.tie(nullptr);int a, b, c;cin >> a >> b >> c;vector<int> ans;if ((b + c) % a == 0) {ans.push_back((b + c) / a);}if (c % a == 0) {int x = c / a;if (a * x - b <= 0) {ans.push_back(x);}}sort(ans.begin(), ans.end());if (ans.size()) {for (auto x : ans) {cout << x << endl;}} else {cout << -1 << endl;}}