Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <queue>
- using namespace std;
- int main()
- {
- int n, t, ct = 0, ct1 = 0, t1, ans = 0;
- queue<int> a;
- cin >> n;
- cin >> t;
- a.push(t);
- cin >> t;
- a.push(t);
- cin >> t;
- a.push(t);
- for (int i = 3; i < n; i++)
- {
- cin >> t;
- a.push(t);
- t1 = a.front();
- a.pop();
- if (t1 % 23 == 0) ct++;
- else ct1++;
- if (t % 23 == 0) ans += ct + ct1;
- else ans += ct;
- }
- cout << ans;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement