Submission #339938

# Submission time Handle Problem Language Result Execution time Memory
339938 2020-12-26T11:43:44 Z ArKCa Pot (COCI15_pot) C++17
50 / 50
1 ms 364 KB
#include<bits/stdc++.h>
#define N   200005
#define ll  long long 
#define int ll
#define N   200005

using namespace std;
int n,sum,a;
int fp(int x,int y){
	if(y==1)return x;
	if(y==0)return 1;
	int a=fp(x,y/2);
	if(y%2)return a*a*x;
	return a*a;
}
int32_t main(){
	// freopen("a.gir","r",stdin);
	// freopen("a.cik","w",stdout);

	scanf("%lld",&n);
	while(n--){
		scanf("%lld",&a);
		sum+=fp((int)a/10,(int)a%10);
		// printf("%lld %lld %lld\n", (int)a/10,(int)a%10 ,sum);
	}
	printf("%lld\n", sum);
}

Compilation message

pot.cpp: In function 'int32_t main()':
pot.cpp:20:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   20 |  scanf("%lld",&n);
      |  ~~~~~^~~~~~~~~~~
pot.cpp:22:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   22 |   scanf("%lld",&a);
      |   ~~~~~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 1 ms 364 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 1 ms 364 KB Output is correct
8 Correct 1 ms 364 KB Output is correct
9 Correct 1 ms 364 KB Output is correct
10 Correct 1 ms 364 KB Output is correct