Cod sursa(job #3135549)
Utilizator | Data | 3 iunie 2023 17:21:10 | |
---|---|---|---|
Problema | Invers modular | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.26 kb |
#include <iostream>
#include <fstream>
#include <cmath>
std::ifstream fin("inversmodular.in");
std::ofstream fout("inversmodular.out");
int main(){
long long int A,N,X;
fin >> A >> N;
X = (long long int)pow(A,N-2) % N;
fout << X;
return 0;
}