Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main() {
- ifstream fin("date.in");
- long x;
- int ans = 0;
- int start = 0, sfarsit = 0, negativ = -1;
- for(int i = 0; fin >> x; ++i) {
- if(x < 0) {
- int interval = sfarsit - start + 1;
- if(interval > ans) {
- ans = interval;
- }
- start = negativ + 1;
- negativ = i;
- }
- sfarsit = i;
- }
- cout << ans;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement