結果

問題 No.186 中華風 (Easy)
ユーザー nmnmnmnmnmnmnmnmnmnmnmnmnmnm
提出日時 2015-04-19 23:53:57
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 985 bytes
コンパイル時間 1,569 ms
コンパイル使用メモリ 85,424 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-18 02:03:57
合計ジャッジ時間 14,611 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 602 ms
4,380 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 614 ms
4,376 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 3 ms
4,376 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 612 ms
4,380 KB
testcase_20 AC 612 ms
4,380 KB
testcase_21 AC 611 ms
4,376 KB
testcase_22 AC 614 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0