Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <unordered_map>
- using namespace std;
- int main() {
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- int N, M;
- cin >> N >> M;
- unordered_map<int, int> last_sent;
- int unread = 0;
- for (int i = 0; i < M; i++) {
- int sender;
- cin >> sender;
- unread -= last_sent[sender];
- last_sent[sender] = unread + 1;
- unread += N - 1;
- cout << unread << "\n";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement