generated from sigonasr2/CPlusPlusProjectTemplate
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
579 B
20 lines
579 B
2 years ago
|
#pragma once
|
||
|
#include <map>
|
||
|
#include <iostream>
|
||
|
|
||
|
namespace internal{
|
||
|
struct PowModStruct{
|
||
|
int a,b,mod;
|
||
|
friend std::ostream& operator << (std::ostream& os, const internal::PowModStruct& rhs) { os << rhs.a << "^" << rhs.b << "%" << rhs.mod; return os; };
|
||
|
bool operator<(const internal::PowModStruct&rhs)const{return a<rhs.a||b<rhs.b||mod<rhs.mod;};
|
||
|
};
|
||
|
}
|
||
|
|
||
|
class utils{
|
||
|
utils()=delete;
|
||
|
utils(utils&utils)=delete;
|
||
|
static std::map<internal::PowModStruct,int>mapping;
|
||
|
public:
|
||
|
//a^b % mod
|
||
|
static int PowMod(int a,int b,int mod);
|
||
|
};
|