Run ID:80796
提交时间:2024-07-11 16:25:15
#include<iostream> using namespace std; int a[1000001]; int main() { int n,k; int first=0,end=0; cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; } cin>>k; for(int i=1;i<=n;i++){ if(a[i]==k){ if(first==0){ first = i; //666,ZheGeShiGua. } end = i; } } if(first==0){ cout<<-1; } cout<<first<<' '<<end; return 0; }