# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
339952 | AlperenT | Pot (COCI15_pot) | C++17 | 1 ms | 492 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
long long n, a, ans;
long long fastpow(long long a, long long b){
if(b == 0) return 1;
if(b % 2 == 0){
long long temp = fastpow(a, b / 2);
return temp * temp;
}
else{
long long temp = fastpow(a, (b - 1) / 2);
return temp * temp * a;
}
}
int main(){
scanf("%lld", &n);
while(n--){
scanf("%lld", &a);
ans += fastpow(a / 10, a % 10);
}
printf("%lld", ans);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |