999A Codeforces
Mishka and contest
Solution in c++
#include <iostream> #include <deque> using namespace std; deque<int> d; int main() { int a,b,sol=0; cin>>a>>b; for(int i=0;i<a;i++){ int t; cin>>t; d.push_front(t); } while(d.back()<=b && d.size()){ if(d.back()<=b && d.size()){sol++;d.pop_back();} } while(d.front()<=b && d.size()){ if(d.front()<=b && d.size()){sol++;d.pop_front();} } cout<<sol<<"\n"; return 0; }
0 التعليقات:
إرسال تعليق