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