2 条题解

  • 1
    @ 2025-11-7 20:58:01
    #include <bits/stdc++.h>
    using namespace std;
    int main(){
        int n,m;
        cin>>n;
        int nums[100000];  
        for(int i=0;i<n;i++)
            cin>>nums[i];
        cin>>m;    
        int first=0;
        int sums=0;    
        for (int i=0;i<n;i++){
            if(nums[i]==m){
                sums++;
                if(first==0){
                    first=i+1;
                }
            }
        }    
        cout<<first<<" "<<sums<<endl;  
        return 0;
    }

    信息

    ID
    1019
    时间
    1000ms
    内存
    128MiB
    难度
    2
    标签
    递交数
    35
    已通过
    25
    上传者