結果
| 問題 |
No.2194 兄弟の掛け引き
|
| コンテスト | |
| ユーザー |
kekenx
|
| 提出日時 | 2024-01-09 14:05:56 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 376 bytes |
| コンパイル時間 | 746 ms |
| コンパイル使用メモリ | 66,432 KB |
| 最終ジャッジ日時 | 2025-02-18 16:43:50 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 WA * 1 |
ソースコード
#include <iostream>
#include <cassert>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int A, B, C; cin >> A >> B >> C;
bool ok = false;
for (int i = 1; i < 1e6; i++) {
int x = i * A;
if (x - B > 0) x -= B;
if (x == C) {
cout << i << endl;
ok = true;
}
}
if (!ok) cout << -1 << endl;
return 0;
}
kekenx