結果
| 問題 | 
                            No.2194 兄弟の掛け引き
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2023-01-20 21:27:34 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 332 bytes | 
| コンパイル時間 | 2,093 ms | 
| コンパイル使用メモリ | 192,788 KB | 
| 最終ジャッジ日時 | 2025-02-10 04:24:22 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 12 WA * 2 | 
ソースコード
#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++){
        int d=i*a;
        if(d>b) d-=b;
        if(d==c){
            cout<<i<<endl;
            ok=true;
        }
    }
    if(!ok){
        cout<<-1<<endl;
    }
    return 0;
}