結果

問題 No.187 中華風 (Hard)
ユーザー narushimasnarushimas
提出日時 2021-04-03 15:54:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,256 bytes
コンパイル時間 3,586 ms
コンパイル使用メモリ 227,576 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-26 06:41:01
合計ジャッジ時間 4,782 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
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 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#ifdef LOCAL
#define _GLIBCXX_DEBUG
#define dbg(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ") " << __FILE__ << endl
#else
#define dbg(x) {}
#endif
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define ll long long
#define ld long double
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep1(i, n) for(int i=1; i<=(n); ++i)
#define rrep(i,n) for(int i = (n)-1; i >= 0; --i)
#define rrep1(i,n) for(int i = (n); i >= 1; --i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define RFOR(i, a, b) for(int i=(a)-1; i>=(b); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(), x.rend()
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define popcnt(x) __builtin_popcountll(x)
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define newline puts("")
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using pdd = pair<ld,ld>;
#define v(T) vector<T>
#define vv(T) v(v(T))
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<ll>;
using vd = vector<ld>; 
using vs = vector<string>;
using vpii = vector<pii>;
using vpl = vector<pll>; 
using vpd = vector<pdd>;
const int dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1};
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
template<class T> using pqg = priority_queue<T,vector<T>,greater<T>>;
using int128 = __int128_t;
using mint = atcoder::modint1000000007;
//using mint = atcoder::modint998244353;
//using mint = atcoder::modint; //mint::set_mod(mod);
#define endl '\n'
const long double eps= 1e-10;
const long double PI = 3.141592653589793238462643383279502884L;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const ll MOD = 1000000007;

void solve() {
  int N; cin >> N;
  vl r(N);
  vl m(N);
  rep(i, N){
    cin >> r[i] >> m[i];
  }
  auto c = crt(r, m);
  if(c.se == 0){
    cout << -1 << endl;
  }else{
    cout << c.fi << endl;
  }
}

int main(){
  int tests = 1;
  // scanf("%d", &tests);
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  rep1(i, tests){
    solve();
  }
  return 0;
}
0