2 条题解

  • -1
    @ 2024-1-24 19:00:44

    数组都不需要

    #include<bits/stdc++.h>
    using namespace std;
    int n,maxn,ans;
    int main(){
    	ios::sync_with_stdio(false);
    	cin.tie(0),cout.tie(0);
    	cin>>n;
    	while(n--){
    		int x;
    		cin>>x;
    		if(x>maxn){
    			maxn=x;ans++;
    		}
    	}
    	cout<<ans;
    	return 0;
    }
    
    

    信息

    ID
    348
    时间
    1000ms
    内存
    64MiB
    难度
    1
    标签
    递交数
    140
    已通过
    69
    上传者