Cod sursa(job #3126871)
| Utilizator | Data | 7 mai 2023 00:59:01 | |
|---|---|---|---|
| Problema | Ridicare la putere in timp logaritmic | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.14 kb |
#import<fstream>
main(){long n,a,p=1,m=2e9-27;for(std::ifstream("lgput.in")>>a>>n;n;a=a*a%m,n/=2)if(n&1)p=p*a%m;std::ofstream("lgput.out")<<p;}
