結果
| 問題 |
No.2194 兄弟の掛け引き
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-01-20 21:43:58 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 1,117 bytes |
| コンパイル時間 | 1,684 ms |
| コンパイル使用メモリ | 186,500 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-23 09:39:53 |
| 合計ジャッジ時間 | 2,442 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
#ifdef MY_LOCAL
#include "D://competitive_programming/debug/debug.h"
#define debug(x) cerr << "[" << #x<< "]:"<<x<<"\n"
#else
#define debug(x)
#endif
#define REP(i, n) for(int i = 0; i < n; i ++)
#define REPL(i,m, n) for(int i = m; i < n; i ++)
#define SORT(arr) sort(arr.begin(), arr.end())
#define LSOne(S) ((S)&-(S))
#define M_PI 3.1415926535897932384
#define INF 1e18
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
#define int ll
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<vii> vvii;
typedef double ld;
typedef tree<int,null_type,less<int>, rb_tree_tag, tree_order_statistics_node_update> ost;
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int a,b,c;cin>>a>>b>>c;
bool found = false;
REPL(i,1, c+b+1) {
int j = i*a;
if (j <= b && j == c) {
cout<<i<<"\n";
found = true;
} else if (j > b && j - b == c) {
cout<<i<<"\n";
found = true;
}
}
if (!found) {
cout<<-1;
}
}