結果
| 問題 | 
                            No.2194 兄弟の掛け引き
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2023-01-20 21:36:28 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 342 bytes | 
| コンパイル時間 | 1,775 ms | 
| コンパイル使用メモリ | 193,840 KB | 
| 最終ジャッジ日時 | 2025-02-10 04:31:57 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 13 WA * 1 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
    int a,b,c;
    cin>>a>>b>>c;
    bool ok=false;
    for(int i=1; i<=100000; i++){
        long long d=1LL*i*a;
        if(d>b) d-=b;
        if(d==c){
            cout<<i<<endl;
            ok=true;
        }
    }
    if(!ok){
        cout<<-1<<endl;
    }
    return 0;
}