为什么这也能过

P1001 A+B Problem

H_LH @ 2024-10-06 19:49:46

#include<bits/stdc++.h>
using namespace std;
const long long N=1e9+10;
int main(){
    int                                                                                                                                                                                                                                                                                                                                                                                                                                                                 a,b;
    cin>>a>>b;
    cout<<a+b+114514-114514;
    return INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX*INT_MAX-1;
}

by Grammar__hbw @ 2024-10-06 19:51:23

@HuangLiHeng 有符号整数溢出是ub;洛谷对返回值自动模256(试试return 998244352


by ImposterAnYu @ 2024-10-06 19:51:36

为啥不过(

虽然写得有点抽象


by HuangSiHan3116 @ 2024-10-06 19:52:16

@HuangLiHeng 呃…………

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b;
    cin>>a>>b;
    cout<<a+b<<endl;
    return 0;
}

by __Function__ @ 2024-10-06 19:54:18

@HuangLiHeng 既然这么难懂的代码都会写,那么这边建议使用LCT神器


by Walrus @ 2024-10-06 19:54:22

wyy,jbl


by InterN_NOT_FOUND @ 2024-10-06 19:54:56

闲的没事试了一下return 1真的会RE的)

不如这个极限


by zshs @ 2024-10-06 19:56:56

@Walrus 孙笑川大王在此,谁敢举报?


by heyizhuo20110420 @ 2024-10-06 22:17:48

#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long a,b;
    while(cin>>a>>b)
        cout<<a+b;
    return 0;
}

by gaomingshuo @ 2024-10-07 18:29:42

@HuangLiHeng 好像还真能过


by gaomingshuo @ 2024-10-07 18:34:15

@InterN_NOT_FOUND 刚好1.00s,《卡点之王》小的开始膜拜


|