为啥代码会厌氧
查看原帖
为啥代码会厌氧
1063618
lxy69cmh楼主2025/7/28 13:03
#include<bits/stdc++.h>
using namespace std;
#define LL long long

LL n,ans[105ll],cnt=1ll;

int main(){
    scanf("%lld",&n);
    ans[1ll]=n;
    while(n!=1){
        if(n%2ll==1ll){
            n=3ll*n+1;
        }else{
            n/=2ll;
        }
        ans[++cnt]=n;
    }
    for(LL i=cnt;i>=1;i--){
        printf("%lld ",ans[i]);
    }
    return 0;
}

代码培养皿 提交记录:

With O2 https://www.luogu.com.cn/record/227344360

Unwith O2 https://www.luogu.com.cn/record/227344389 两次代码完全一样

有大佬知道这是为什么吗?

2025/7/28 13:03
加载中...