【高精度】高精度幂

问题 D: 【高精度】高精度幂

时间限制: 1 Sec  内存限制: 64 MB

题目描述

经过测试,修罗王发现打开魔法手铐的方法是需要求一个正整数a(1<a<10100)的N(1<N<108)次方,但只要求输出最后1000位(若不够1000位,则只输出实际位数,若超过1000位,即使首位为0也同样输出)。

 

输入

包含两个数字,即a和N。

 

输出

输出结果的最后1000位。

 

样例输入

复制样例数据

2 10

样例输出

1024

注意c数组不能只取1000为万一第1000为为0不就舍掉了,到最后在输出1000位

/**/
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <stack>
#include <queue>

typedef long long LL;
using namespace std;

int n;
char ans[2005];
int tot;

void solve(char p[], char a[]){
	int c[2005];
	memset(c, 0, sizeof(c));
	int lenp = strlen(p), lena = strlen(a);
	lenp = min
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值