# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
377443 | marat0210 | Pot (COCI15_pot) | C++14 | 1 ms | 364 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 power(long long n, long long p)
{
long long k = n;
for (int i = 0; i < p - 1; ++i) {
n *= k;
}
return n;
}
int main()
{
long long n;
cin >>n;
vector <long long> p(n);
vector <long long> a(n);
for (int i = 0; i < n; ++i) {
long long k;
cin >>k;
p[i] = k % 10;
a[i] = k / 10;
}
long long sum = 0;
for (int i = 0; i < n; ++i) {
sum += power(a[i], p[i]);
}
cout <<sum<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |