結果

問題 No.3179 3 time mod
ユーザー toku4388
提出日時 2025-06-13 22:37:46
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 360 bytes
コンパイル時間 2,721 ms
コンパイル使用メモリ 281,092 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-14 01:43:13
合計ジャッジ時間 4,001 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 42
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <atcoder/math>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
	ll n;
	cin >> n;
	vector<ll> p(3), r(3);
	for (int i = 0; i < 3; i++) {
		cin >> p[i];
	}
	for (int i = 0; i < 3; i++) {
		cin >> r[i];
	}
	auto [tr, tm] = atcoder::crt(r, p);
	ll ans = n / tm;
	if (n % tm >= tr) ans++;
	cout << ans << endl;
	return 0;
}
0