結果

問題 No.3186 Big Order
ユーザー tails
提出日時 2025-06-22 04:36:07
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 14 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 8,014 ms
コンパイル使用メモリ 361,260 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-22 04:36:18
合計ジャッジ時間 8,067 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <numeric>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp=boost::multiprecision;
int main(){
	std::cin.tie(nullptr);
	std::ios::sync_with_stdio(false);
    int t;
	std::cin>>t;
	for(;t--;){
		mp::uint512_t a,b,c,d=1;
		std::cin>>a>>b>>c;
		mp::uint256_t z=0;
		for(int i=133;i--;){
			d*=d;
			z*=2;
			if(b>>i&1){
				d*=a;
			}
			while(d%c==0){
				d/=c;
				z+=1;
			}
			d=gcd(d,c);
		}
		std::cout<<z%998244353<<'\n';
	}
}
0