2 条题解
- 1
信息
- ID
- 2916
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 8
- 标签
- 递交数
- 525
- 已通过
- 125
- 上传者
#include <bits/stdc++.h>
#define LL long long
using namespace std;
int a , b , c = 1;
const int N = 1e9;
const int INF = 0x3f3f3f3f;
int main()
{
cin >> a >> b;
for (LL i = 1; i <= b; i++)
{
c *= a;
if (c > N || c <= 0)
{
cout << -1;
return 0;
}
}
cout << c;
return 0;
}