又是我,请求添加 hack 数据
查看原帖
又是我,请求添加 hack 数据
542457
cff_0102sky & aqua楼主2024/1/13 19:30

刚刚我题解被人回了,就来看看,发现讨论区一个AC代码有问题。

补全后的 AC 代码:

#include<bits/stdc++.h>
using namespace std;
#define int long long
void solve()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    int mx1 = max(abs(a),abs(b));
    int mx2 = max(abs(c),abs(d));

    int mx = mx1*mx2;
    if(mx<=2147483648){
        cout<<"int\n";
        return ;
    }
    cout<<"long long int\n";
}
signed main(){
    solve();
    return 0;
}

hack:

1073741824 1073741824
2 2

ans:

long long int

wrong output:

int
2024/1/13 19:30
加载中...