# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
604405 | inksamurai | Pot (COCI15_pot) | C++17 | 1 ms | 340 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>
#define int long long
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define sz(a) (int)a.size()
#define _3Pxrs5V ios::sync_with_stdio(0),cin.tie(0)
void print(){cout<<'\n';}
template<class h,class...t>
void print(const h&v,const t&...u){cout<<v<<' ',print(u...);}
//e
signed main(){
_3Pxrs5V;
int n;
cin>>n;
int ans=0;
rep(i,n){
string s;
cin>>s;
int ch=s.back()-'0';
int v=0;
rep(i,sz(s)-1){
v=v*10+s[i]-'0';
}
// print(v);
int val=1;
rep(i,ch){
val*=v;
}
ans+=val;
}
print(ans);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |