Submission #1265544

#TimeUsernameProblemLanguageResultExecution timeMemory
1265544herominhstevePot (COCI15_pot)C++20
50 / 50
0 ms328 KiB
#include <bits/stdc++.h> #define el '\n' #define FNAME "NAME" #define allof(x) x.begin(),x.end() #define allof1(x) x.begin()+1,x.end() #define mset(x,n) memset(x,(n),sizeof(x)) const long long MOD = (long long) 1e9+7; template<class X,class Y> bool minimize(X &a,Y b){ if (a>b) {a=b; return true;} return false;} template<class X,class Y> bool maximize(X &a,Y b){ if (a<b) {a=b; return true;} return false;} void setup(){ std::ios_base::sync_with_stdio(0); std::cin.tie(0);std::cout.tie(0); if (fopen(FNAME".inp","r")){ freopen(FNAME".inp","r",stdin); freopen(FNAME".out","w",stdout); } } unsigned int indianpow(unsigned int a, unsigned int b){ if (!b) return 1; unsigned int x = indianpow(a,b/2); x = x * x; if (b&1) return a*x; return x; } int n; void init(){ std::cin>>n; } void sol(){ unsigned int res = 0; for (int i=0;i<n;i++){ unsigned int x; std::cin>>x; unsigned int expo = x % 10; unsigned int num = x/10; res+= indianpow(num,expo); } std::cout<<res; } int main(){ setup(); init(); sol(); }

Compilation message (stderr)

pot.cpp: In function 'void setup()':
pot.cpp:15:24: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |                 freopen(FNAME".inp","r",stdin);
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
pot.cpp:16:24: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |                 freopen(FNAME".out","w",stdout);
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...