为毛40?求教

P1634 禽兽的传染病

```cpp var n,y,j:longint; x:qword; begin read(x,n); y:=x+1; x:=1; for j:=1 to n do x:=y*x; write(x); end. ```
by yuzoe @ 2016-08-24 18:48:48


用long就行
by chenjw @ 2016-09-16 22:16:32


数据很禽兽,需要int64
by rsjztz @ 2016-11-01 15:45:17


把s改成qword或int64
by PhenixLee @ 2016-11-13 20:36:57


```cpp #include<cstdio> #include<cmath> #include<iostream> #include<cstdlib> #include<string> #include<iomanip> #include<cstring> #include<ctime> #include<algorithm> #include<queue> using namespace std; int main(){ int x,n; scanf("%d%d",&x,&n); long long ans=1,l; for(int i=0;i<n;i++){ l=ans*x; ans+=l; } printf("%lld\n",ans); return 0; } ```
by wd050602 @ 2016-12-08 17:37:08


longint肯定只能得40,后面三个数据太大,用int64就能通过了
by KillerXu @ 2017-01-29 08:42:30


我也只有40分
by 悦儿弯弯 @ 2017-03-12 11:47:29


上一页 |