95分求助互粉

P1401 [入门赛 #18] 禁止在 int 乘 int 时不开 long long

@[npc000](/user/1234029) int上限是2147483647,把t的值改为2147483647
by PengDave @ 2023-12-29 21:01:34


int 类型可以表示的最小值为 −2147483648,最大值2147483647
by Pitiless_boy @ 2023-12-29 21:01:48


还是错啊??
by npc000 @ 2023-12-29 21:02:46


@[npc000](/user/1234029)
by Pitiless_boy @ 2023-12-29 21:02:51


t不是2147483648,是2147483647
by chenyyegg @ 2023-12-29 21:03:49


是的
by Pitiless_boy @ 2023-12-29 21:04:51


改了,还是95
by npc000 @ 2023-12-29 21:05:10


```cpp #include<bits/stdc++.h> #pragma optimize(3) using namespace std; signed long long a,b,i,j=1,k=0,n,m,x,y,s=0,sum=0,num=-2147483648,t=2147483647,maxn=-99999999,minn=99999999,flag[30]={0}; double oo; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>a>>b>>x>>y; if(a*x<=t&&a*x>=num&&b*y<=t&&b*y>=num&&a*y<=t&&a*y>=num&&b*x<=t&&b*x>=num) { cout<<"int"; } else { cout<<"long long int"; } return 0; } ```
by laixiaoyang @ 2023-12-29 21:06:31


@[npc000](/user/1234029) 条件少了,加上就对了
by laixiaoyang @ 2023-12-29 21:07:36


正解
by Pitiless_boy @ 2023-12-29 21:07:37


| 下一页