警钟敲烂,不开 unsigned long long 见祖宗
查看原帖
警钟敲烂,不开 unsigned long long 见祖宗
745003
zhangjingxing2012楼主2022/10/30 15:28

rt,CSP-J2 T1不开 unsigned long long 见祖宗

你谷民间数据这个代码80:

#include<bits/stdc++.h>
using namespace std;
#define intger 1000000000
int main()
{
	long long a,b,c;
	cin>>a>>b;
	c=pow(a,b);
	if(c>intger) cout<<-1;
	else cout<<c;
	return 0;
} 

这个就100了:

#include<bits/stdc++.h>
using namespace std;
#define intger 1000000000
int main()
{
	unsigned long long a,b,c;
	cin>>a>>b;
	c=pow(a,b);
	if(c>intger) cout<<-1;
	else cout<<c;
	return 0;
} 

反正我这个代码是这样的

2022/10/30 15:28
加载中...