結果
| 問題 |
No.2194 兄弟の掛け引き
|
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2023-02-15 15:30:49 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 363 bytes |
| コンパイル時間 | 1,613 ms |
| コンパイル使用メモリ | 169,020 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-18 00:42:55 |
| 合計ジャッジ時間 | 2,180 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
int ma = 1e5;
vector<int> ans;
for( long long x = 1; x < 3 * ma + 1; x++ ) {
long long y = x * A - B;
if( y <= 0 ) y = x * A;
if( y == C ) ans.push_back( x );
}
if( ans.size() == 0 ) cout << -1 << endl;
else {
for( int e : ans ) cout << e << endl;
}
}
forest3