80分求助
查看原帖
80分求助
1366352
Magic_ant楼主2024/7/7 10:33

两个错误

#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
ull n,cnt,ppre,pre,fbnq,flag=false;
int main(){
    ios::sync_with_stdio(0);cin.tie();cout.tie();
    cin>>n;
    for(int i=0;i<n;i++){
        if(flag){cnt++;continue;}
        ull x;cin>>x;
        if(!i) ppre=pre=fbnq=x;
        if(i>1){
            ppre=pre;
            pre=fbnq;
            fbnq+=ppre;
        }
        if(x!=fbnq) cnt++;
        if(fbnq>1000000) flag=true;
    }
    cout<<cnt;
    return 0;
}
2024/7/7 10:33
加载中...