結果

問題 No.3179 3 time mod
ユーザー eve__fuyuki
提出日時 2025-06-27 16:09:42
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 394 bytes
コンパイル時間 2,249 ms
コンパイル使用メモリ 200,764 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-27 16:09:46
合計ジャッジ時間 4,406 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 42
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

void fast_io() {
	ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
}

#include <atcoder/math>
using namespace atcoder;

int main() {
	fast_io();
	long long n;
	cin >> n;
	long long p, q, r;
	cin >> p >> q >> r;
	long long a, b, c;
	cin >> a >> b >> c;
	auto [y, z] = crt({a, b, c}, {p, q, r});
	cout << n / z + (n % z >= y ? 1 : 0) << endl;
}
0