Borderou de evaluare (job #2460247)

Utilizator cristian51090Oanta Cristian cristian51090 Data 23 septembrie 2019 10:17:49
Problema Ridicare la putere in timp logaritmic Status done
Runda Arhiva educationala Compilator cpp-64 | Vezi sursa
Scor 0

Raport evaluator

Eroare de compilare: main.cpp: In function 'long long int modpow(long long int, long long int)': main.cpp:5:35: error: 'MOD' was not declared in this scope ll modpow(ll a,ll b) {ll res=1;a%=MOD;for(;b;b>>=1){if(b&1)res=res*a%MOD;a=a*a%MOD;}return res;} ^~~ main.cpp: In function 'T Pow(T, T, T)': main.cpp:6:56: error: 'ull' was not declared in this scope template <typename T> inline T Pow(T base,T exp,T mod){ull x = 1, y = base;while(exp>0){if(exp&1) x = Mulmod(x,y,mod);y = Mulmod(y,y,mod);exp >>= 1;}return x;} ^~~ main.cpp:6:99: error: 'x' was not declared in this scope template <typename T> inline T Pow(T base,T exp,T mod){ull x = 1, y = base;while(exp>0){if(exp&1) x = Mulmod(x,y,mod);y = Mulmod(y,y,mod);exp >>= 1;}return x;} ^ main.cpp:6:112: error: 'y' was not declared in this scope template <typename T> inline T Pow(T base,T exp,T mod){ull x = 1, y = base;while(exp>0){if(exp&1) x = Mulmod(x,y,mod);y = Mulmod(y,y,mod);exp >>= 1;}return x;} ^ main.cpp:6:119: error: 'y' was not declared in this scope template <typename T> inline T Pow(T base,T exp,T mod){ull x = 1, y = base;while(exp>0){if(exp&1) x = Mulmod(x,y,mod);y = Mulmod(y,y,mod);exp >>= 1;}return x;} ^ main.cpp:6:157: error: 'x' was not declared in this scope template <typename T> inline T Pow(T base,T exp,T mod){ull x = 1, y = base;while(exp>0){if(exp&1) x = Mulmod(x,y,mod);y = Mulmod(y,y,mod);exp >>= 1;}return x;} ^ main.cpp: In function 'int main()': main.cpp:13:21: error: too many arguments to function 'long long int modpow(long long int, long long int)' fout << modpow(a,b,c); ^ main.cpp:5:4: note: declared here ll modpow(ll a,ll b) {ll res=1;a%=MOD;for(;b;b>>=1){if(b&1)res=res*a%MOD;a=a*a%MOD;}return res;} ^~~~~~ Non zero exit status: 1

Ceva nu functioneaza?