3 solutions

  • 6
    @ 2025-8-15 14:09:00
    #include<bits/stdc++.h>
    using namespace std;
    int n,h,m;
    int main(){
    	int t;
    	cin>>n>>h>>m;
    	for(int i=1;i<=n;i++){
    		cin>>t;
    		if(h+t>=m){
    			cout<<i;
    			return 0;
    		} 
    	}
    	return 0;
    }
    
  • 3
    @ 2025-3-30 14:09:45
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n,h,w;cin>>n>>h>>w;
    	for(int i=1;i<=n;i++)
    	{
    		int m;cin>>m;
    		if (h+m>=w){cout<<i;
    		break;}
    	}
    	return 0;
    }
    
    • 0
      @ 2026-8-4 10:18:29
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          int n,h,x,t;
      	cin>>n>>h>>x;
      	for(int i=1;i<=n;i++)
      	{
      		cin>>t;
      	    if(t+h>x)
      		{
      			cout<<i;
      			return 0;
      		}
      	}
      	return 0; 
      }
      
      • 1

      Information

      ID
      2338
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      1
      Tags
      # Submissions
      167
      Accepted
      75
      Uploaded By