Đề thi thử đợt 1 TS10 chuyên Tin trường THPT Chuyên KHTN 2026


Bình luận

Hãy đọc nội quy trước khi bình luận.



  • 0
    missmphuog  đã bình luận lúc 7, Tháng 3, 2026, 9:05
    #include <bits/stdc++.h>
    using namespace std;
    
    #define ll long long
    #define ull unsigned long long
    #define ld long double
    
    #define pb push_back
    #define pf push_front
    #define fi first
    #define se second
    
    #define all(x) (x).begin(), (x).end()
    #define rall(x) (x).rbegin(), (x).rend()
    
    #define faster() ios::sync_with_stdio(false); cin.tie(nullptr);
    #define endl '\n'
    
    #define yes cout << "YES\n"
    #define no  cout << "NO\n"
    
    #define pii pair<int,int>
    #define pll pair<ll,ll>
    #define vi vector<int>
    #define vl vector<ll>
    const int maxn = 1e6;
    int a[maxn+10],n,d=0;
    int main() {
        faster();
        cin>>n;
        map<int,int> mp;
        for(int i=1;i<=n;i++) {
            cin>>a[i];
            mp[a[i]]++;
        }
        vi v;
        for(auto it:mp) {
            if(it.second>=3) {
                v.push_back(it.first);
            }
        }
        if(!v.empty()) cout<&lt;v[0];
        else cout<<-1;
        return 0;
    }