Cod sursa(job #3239016)
Utilizator | Data | 1 august 2024 13:00:39 | |
---|---|---|---|
Problema | Invers modular | Scor | 30 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.27 kb |
#include <iostream>
#include <fstream>
int main(){
std::ifstream bem("inversmodular.in");
long long a, n;
bem >> a >> n;
bem.close();
long long x = 1;
while(a*x % n != 1)
x++;
std::ofstream kim("inversmodular.out");
kim << x << "\n";
kim.close();
return 0;
}