Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define ll long long
- #define ld long double
- #define pb push_back
- using namespace std;
- const long long INF = 1073741823;
- struct obj
- {
- int l = 100001, r = 0, kol = 0, init, isdel = 0;
- };
- obj a[101];
- int b[100001];
- bool comp(const obj& n, const obj& m)
- {
- return n.kol > m.kol;
- }
- int main()
- {
- freopen("input.txt", "r", stdin);
- // freopen("output.txt", "w", stdout);
- int n, x;
- cin >> n;
- int mxkol = 0;
- vector<int> mxid;
- for(int i = 0;i < n; i++)
- {
- cin >> x;
- b[i] = x;
- a[x].kol += 1;
- a[x].init = x;
- a[x].l = min(a[x].l, i);
- a[x].r = max(a[x].r, i);
- if(a[x].kol >= mxkol)
- {
- if(a[x].kol > mxkol)
- {
- mxid.clear();
- mxid.pb(x);
- mxkol = a[x].kol;
- }else
- {
- mxid.pb(x);
- mxkol = a[x].kol;
- }
- }
- }
- sort(a, a + 100, comp);
- int ans = n;
- for(int i = 0; i <= 100; i++)
- {
- int tl = a[i].l, tr = a[i].r, k = a[i].kol;
- int ab = abs(tl - tr);
- if(k > 1)
- {
- if(ab != 1 && ab != 100001)
- {
- if(a[i].isdel == 0)
- {
- for(int j = tl + 1;j < tr; j++)
- {
- }
- cout << endl;
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement