Cod sursa(job #3322896)
| Utilizator | Data | 16 noiembrie 2025 10:13:30 | |
|---|---|---|---|
| Problema | Invers modular | Scor | 30 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.35 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin ("inversmodular.in");
ofstream fout ("inversmodular.out");
int main()
{
long long N,P;
fin>>N>>P;
for(int i=1;i<P;i++)
{
long long x=i*N;
if(x%P==1)
{
fout<<i;
i=P;
}
}
return 0;
}
