Skip to content

Instantly share code, notes, and snippets.

@invatainfo
Created September 24, 2017 17:44
Show Gist options
  • Save invatainfo/6645d89a1d6a5cfd2839508874f4fa57 to your computer and use it in GitHub Desktop.
Save invatainfo/6645d89a1d6a5cfd2839508874f4fa57 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <fstream>
using namespace std;
int main() {
ifstream f("date.in");
int prec,a,urm,nr = 0;
f >> a;
prec = -1;
while (f >> urm) {
if (a < prec + urm && prec != -1)
nr++;
prec = a;
a = urm;
}
cout << nr;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment