#include #include #include #include #include #include using namespace std; const double YOLO = 0.00000000001; struct sample { int m_time; int m_value; }; struct condition { string m_operator; string m_function; int m_time; }; sample * sampleArr; condition * condArr; int ** RQMin; int ** RQMax; int findSmallerOrEqualExponentOfTwo(int in); int getMax(int from, int to) { int rozdil=to-from; int k = findSmallerOrEqualExponentOfTwo(rozdil); int d=1; for(int i=0;itime) { return bin(from,mid,time); } else { return bin(mid+1,to,time); } } int findSmallerOrEqualExponentOfTwo(int in) { int res=-1; int d=1; while(d<=in) { res++; d*=2; } return res; } int main() { // cout<>sampleCount) { sampleArr = new sample [sampleCount]; for(int i=0;i>sampleArr[i].m_time>>sampleArr[i].m_value; } int conditionCount; cin>>conditionCount; condArr = new condition[conditionCount]; string flush; getline(cin,flush); for(int i=0;i=sampleCount) { RQMin[j][i]=-1; RQMax[j][i]=-1; } else { RQMin[j][i]=min(RQMin[j][i-1],RQMin[j+d][i-1]); RQMax[j][i]=max(RQMax[j][i-1],RQMax[j+d][i-1]); } } d*=2; } int * startIndexArr = new int [sampleCount]; /* for(int i=0;ivalue+YOLO) { result++; } } if(condArr[c].m_operator=="lt") { if(sampleArr[i].m_value