Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int cnt2,cnt5,cnt10,n,i,ans;
- cnt2 = 0;
- cnt5 = 0;
- cnt10 = 0;
- ans = 0;
- cin >> n;
- int a[n];
- for (i = 0; i < n; i++)
- cin >> a[i];
- for (i = 10; i < n; i++){
- cin >> a[i];
- if (a[i-10] % 2 == 0)
- cnt2++;
- if (a[i-10] % 5 == 0)
- cnt5++;
- if (a[i-10] % 10 == 0)
- cnt10++;
- if (a[i] % 10 == 0)
- ans += i-9;
- if (a[i] % 2 == 0 && a[i] % 5 != 0)
- ans += cnt5;
- if (a[i] % 5 == 0 && a[i] % 2 != 0)
- ans += cnt2;
- if (a[i] % 2 != 0 && a[i] % 5 != 0)
- ans+= cnt10;
- }
- cout << ans << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement