12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- #include "socketio.hpp"
- #include "BigInt64.hpp"
- #include <xoshiro.hpp>
- #include <iostream>
- #include <chrono>
- unsigned long long nanoTime(){
- using namespace std;
- using namespace std::chrono;
- return duration_cast<nanoseconds>(high_resolution_clock::now().time_since_epoch()).count();
- }
- template<typename T>
- std::ostream& operator<<(std::ostream& out, std::vector<T> o){
- out << "[";
- for(unsigned int i = 0;i < o.size();i++){
- if(o[i] == '\r')continue;
- out << o[i];
- if(i < o.size() - 1)
- out << ", ";
- }
- return out << "]";
- }
- template<>
- std::ostream& operator<< <char>(std::ostream& out, std::vector<char> o){
- for(unsigned int i = 0;i < o.size();i++){
- out << o[i];
- }
- return out;
- }
- int main(){
- xoshiro_256 gen(1);
- BigInt a(364598273448762ULL);
- BigInt b(gen, 14);
- BigInt mod("9301165293246235069759966068146313776551258669855356477271940698500929939755418247622530571466332330697816620308003246225290293476785304004840090056840661553451916748315356563734257724978000166406621823207925733850455027807451108123161768212073821382033500073069184011344280494573919716117539258909003");
- std::cout << "(" << a.toString() << " ^ " << std::flush;
- a = a.modPow(b, mod);
- std::cout << "" << b.toString() << ")";
- std::cout << " mod " << mod.toString() << "\n";
- std::cout << " = " << a.toString() << "\n";
- }
|