| 比赛 | 20160303 | 评测结果 | AAAAAAWAWW |
|---|---|---|---|
| 题目名称 | 大整数取模 | 最终得分 | 70 |
| 用户昵称 | Rapiz | 运行时间 | 0.002 s |
| 代码语言 | C++ | 内存使用 | 0.29 MiB |
| 提交时间 | 2016-03-03 20:33:12 | ||
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
const int MAXN=100+10;
char buf[MAXN];
long m;
int main(){
freopen("bigint.in","r",stdin);
freopen("bigint.out","w",stdout);
scanf("%s%ld",buf,&m);
int len=strlen(buf);
long ans=0;
for(int i=0;i<len;i++) ans*=10,ans+=buf[i]-'0',ans%=m;
printf("%ld",ans);
}