結果
| 問題 | No.186 中華風 (Easy) |
| コンテスト | |
| ユーザー |
nmnmnmnmnmnmnm
|
| 提出日時 | 2015-04-19 23:53:57 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 985 bytes |
| 記録 | |
| コンパイル時間 | 577 ms |
| コンパイル使用メモリ | 86,292 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-04 18:57:00 |
| 合計ジャッジ時間 | 12,912 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 16 |
ソースコード
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(long long i=(a);i<(b);++i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define MOD 1000000007
int main(){
int x1,y1,x2,y2,x3,y3;
cin>>x1>>y1;
cin>>x2>>y2;
cin>>x3>>y3;
if(y1>y2){
swap(y1,y2);
swap(x1,x2);
}
if(y2>y3){
swap(y2,y3);
swap(x2,x3);
}
rep(i,0,60000000){
long long a = (long long)y3*i+x3;
if(a%y1==x1&&a%y2==x2){
cout << a << endl;
return 0;
}
}
cout << -1 << endl;
return 0;
}
nmnmnmnmnmnmnm