結果
問題 | No.2194 兄弟の掛け引き |
ユーザー |
![]() |
提出日時 | 2023-03-06 04:46:23 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 394 bytes |
コンパイル時間 | 1,962 ms |
コンパイル使用メモリ | 193,164 KB |
最終ジャッジ日時 | 2025-02-11 05:43:09 |
ジャッジサーバーID (参考情報) |
judge5 / 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;bool f = false;for(int i = 1; i <= 200000; i++) {long long now = 1ll*i*a;if(now > b) now -= b;if(now == c) {cout << i << endl;f = true;}}if(!f) cout << -1 << endl;}