結果

問題 No.3115 One Power One Kill
ユーザー Pechi
提出日時 2025-04-19 01:19:49
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 2,753 bytes
コンパイル時間 6,182 ms
コンパイル使用メモリ 171,352 KB
実行使用メモリ 25,996 KB
平均クエリ数 2.00
最終ジャッジ日時 2025-04-19 01:20:02
合計ジャッジ時間 9,081 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include<bits/stdc++.h>
//#include<unordered_set>
//#include<random>
//#include <array>
//#include <complex>
//#include<chrono>
//#include<boost/multiprecision/cpp_int.hpp>
//#include <atcoder/all>
//using namespace boost::multiprecision;

using namespace std;
//using namespace atcoder;
#define LP(I,S,G) for (long long int I = (S); I < (G); ++I)
#define IN(X) 	for (int in = 0; in < X.size(); in++)cin >> X[in]
#define OUT(X) 	for (int in = 0; in < X.size(); in++)cout << X[in]<<" "
#define SORT(X) sort((X).begin(), (X).end())
#define CSORT(X,Y) sort(X.begin(), X.end(),Y)
#define COPY(X,Y) copy(X.begin(), X.end(), Y.begin())
#define ALL(X,Y) for (auto &(X) :(Y))
#define FULL(a)  (a).begin(),(a).end()
#define BFS(Q,S) for(Q.push(S);Q.size()!=0;Q.pop())
typedef long long int ll;
typedef unsigned long long int ull;
long long int M = 998244353;

chrono::system_clock::time_point starttime;
using namespace std::chrono;

inline float getTime() {
	return duration_cast<milliseconds>(system_clock::now() - starttime).count();
}


int dx[] = { -1,0,1,0 }, dy[] = { 0,1,0,-1 };

ll MAX(ll A, ll B) { return ((A) > (B) ? (A) : (B)); }
ll MIN(ll A, ll B) { return ((A) < (B) ? (A) : (B)); }
inline long long int xor128() {
	static long long int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
	long long int t = (x ^ (x << 11));
	x = y; y = z; z = w;
	return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}

struct HashPair {

	//注意 constがいる
	template<class T1, class T2>
	size_t operator()(const pair<T1, T2>& p) const {

		//first分をハッシュ化する
		auto hash1 = hash<T1>{}(p.first);

		//second分をハッシュ化する
		auto hash2 = hash<T2>{}(p.second);

		//重複しないようにハッシュ処理
		size_t seed = 0;
		seed ^= hash1 + 0x9e3779b9 + (seed << 6) + (seed >> 2);
		seed ^= hash2 + 0x9e3779b9 + (seed << 6) + (seed >> 2);
		return seed;
	}
};

long long int pow_n(long long int x, long long int n) {
	if (n == 0)
		return 1;
	if (n % 2 == 0)
		return pow_n(x * x%M, n / 2);
	else
		return x * pow_n(x, n - 1)%M;
}

class s_b_j {
public:
	vector<long long int> t;
	s_b_j(int s) :t(s + 1, 1) {
		for (int i = 2; i <= s; i++) {
			if (t[i] == 1) {
				for (int k = i; k <= s; k += i) {
					if (t[k] == 1)t[k] = i;
				}
			}
		}
	}
	unordered_map<long long int, int> operator()(long long int n) {
		unordered_map<long long int, int> s;
		while (n != 1) {
			if (s.find(t[n]) == s.end())s[t[n]] = 1;
			else s[t[n]] += 1;
			n /= t[n];
		}
		return s;
	}
};


int main() {
	M = 92678;
	cout << "45880 92678" << endl;
	ll k;
	cin >> k;
	cout << pow_n(k, 45880) << endl;
	cin >> k;
	return 0;
}
0