Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- int main() {
- int n, m;
- cin >> n >> m;
- vector<int> v(n + 1, 0);
- for(int i = 0; i < m; i++) {
- int x;
- cin >> x;
- v[x] = 0;
- int res = 0;
- for(int j = 1; j <= n; j++) {
- if(j != x) {
- v[j]++;
- res += v[j];
- }
- }
- cout << res << " " ;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement