結果

問題 No.2558 中国剰余定理
ユーザー Ayush RawatAyush Rawat
提出日時 2023-12-07 19:44:46
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 382 bytes
コンパイル時間 1,612 ms
コンパイル使用メモリ 166,072 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-27 02:18:53
合計ジャッジ時間 2,828 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

// C++ Program to find sum of Fibonacci numbers in 
// O(Log n) time.
#include <bits/stdc++.h>
using namespace std;
const long long MAX = LLONG_MAX;


// Driver program to test above function

int main()
{
	long long  ans = 0;
	int A,B,a,b;
	cin>>A>>B>>a>>b;
	for(ans=0; ans<MAX; ans++){
		if(ans%A ==a && ans%B == b){
			cout<<ans<<"\n";
			return 0;
		}
	}
}
0