結果

問題 No.186 中華風 (Easy)
ユーザー Kei
提出日時 2024-09-20 11:06:33
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 365 bytes
コンパイル時間 3,167 ms
コンパイル使用メモリ 278,544 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-20 11:06:40
合計ジャッジ時間 3,869 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<atcoder/math>
using namespace std;
int main() {
	int N = 3;
	vector<long long> X(N), Y(N);
	for (int i = 0; i < N; i++) {
		cin >> X[i] >> Y[i];
	}
	pair<long long, long long> P = atcoder::crt(X, Y);
	long long ans = P.first;
	if (P.first == 0) ans = P.second;
	if (P == make_pair(0LL, 0LL)) {
		ans = -1;
	}
	cout << ans << endl;
}
0