Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Pirnog Theodor Ioan
- Colegiul National "B. P. Hasdeu"
- */
- #include <fstream>
- using namespace std;
- ifstream cin1("lowmem.in");
- ifstream cin2("lowmem.in");
- ofstream cout("lowmem.out");
- int n, k, x, l, ans, t;
- int main(){
- cin1 >> n >> k;
- for(int i = 1; i <= n; i++){
- cin1 >> x;
- t = x;
- }
- cin2 >> n >> k;
- for(int i = 1; i <= n; i++){
- cin2 >> x;
- if(x <= t)
- l++;
- else{
- if(l >= k)
- ans += l - k + 1;
- l = 0;
- }
- }
- if(l >= k)
- ans += l - k + 1;
- cout << ans;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement