标签:service lane
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { int N,T,tem; cin>>N>>T; int a[N-1]; for(int i = 0;i < N;i++) { cin>>tem; if(tem>=1 && tem <=3) a[i] = tem; } while(T--) { int i,j,m; int min; cin>>i>>j; if(i < j && i >= 0 && j < N && j-i >=1) { min = a[i]; for(m = i+1;m <= j;m++) { if(a[m] < min) min = a[m]; } cout<<min<<endl; } else cout<<"input error!"<<endl; } /* Enter your code here. Read input from STDIN. Print output to STDOUT */ return 0; }
标签:service lane
原文地址:http://9320314.blog.51cto.com/9310314/1558246