听取WA声一片(悬关)

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

想清楚一些。 ``` #include <bits/stdc++.h> using namespace std; long long a,b,x,y; int main() { cin>>a>>b>>x>>y; if(1LL*b*x>2147483647||1LL*b*x<-2147483648||1LL*a*y>2147483647||1LL*a*y<-2147483648||1LL*a*x>2147483647||1LL*a*x<-2147483648||1LL*b*y>2147483647||1LL*b*y<-2147483648)//-2147483648也是int,当a=-2147483648,b=0,x=0,y=2147482647时,你的原来代码不对 { cout<<"long long int"<<endl; } else { cout<<"int"<<endl; } return 0; } ```
by sbno333 @ 2024-01-28 22:04:53


加了下限乘上限和上限乘下线之后100,但是#101 [没过](https://www.luogu.com.cn/record/144895603)
by lzj20110120 @ 2024-01-28 22:08:19


又一个被我hack的hh
by cff_0102 @ 2024-01-28 22:10:15


写简单点([供参考](https://www.luogu.com.cn/record/144897204)
by HeYilin @ 2024-01-28 22:21:10


|