Submission #604405

#TimeUsernameProblemLanguageResultExecution timeMemory
604405inksamuraiPot (COCI15_pot)C++17
50 / 50
1 ms340 KiB
#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 timeMemoryGrader output
Fetching results...