ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2050E - Three Strings
Language: C++17 (GCC 7-32)

Previous submission (verdict: Runtime error on test 16):
#include <bits/stdc++.h>

#define int long long
using namespace std;

const int MAXN = 2e3 + 5;
int dp[MAXN][MAXN];

signed main() {
	
	int t;
	cin >> t;

	while (t--) {
		string a, b;
		cin >> a >> b;

		string c;
		cin >> c;

		int na = a.size(), nb = b.size();

		a = "a" + a;
		b = "a" + b;
		c = "a" + c;

		for (int i = 0; i <= na; i++)
			for (int j = 0; j <= na + nb; j++) 
				dp[i][j] = 1e18;

		dp[0][0] = 0;

		for (int i = 0; i <= na; i++) {
			for (int j = 0; j <= na + nb; j++) {
				// i chars from a, j chars from c, minimum change
				// k chars from b
				int k = j - i;
				if (i > 0 && j > 0 && c[j] == a[i]) dp[i][j] = min(dp[i][j], dp[i - 1][j - 1]);
				if (j > 0 && k > 0 && c[j] == b[k]) dp[i][j] = min(dp[i][j], dp[i][j - 1]);
				if (i > 0 && j > 0) dp[i][j] = min(dp[i][j], dp[i - 1][j - 1] + 1);
				if (j > 0 && k > 0) dp[i][j] = min(dp[i][j], dp[i][j - 1] + 1);
			}
		}

		cout << dp[na][na + nb] << '\n';
	}		
}

Submission (verdict: Runtime error on test 13):
#include <bits/stdc++.h>

#define int long long
 
#define fileopen(a, b) freopen(((std::string)a + ".inp").c_str(), "r", stdin); freopen(((std::string)b + ".out").c_str(), "w", stdout);
#define fileopen1(a) freopen(((std::string)a + ".inp").c_str(), "r", stdin); freopen(((std::string)a + ".out").c_str(), "w", stdout);
 
#ifdef PICHU_LOCAL_DEF
	#include <chrono>
#endif
 
using namespace std;

const int MAXN = 2e3 + 5;
int dp[MAXN][MAXN];

signed main() {
	cin.tie(0)->sync_with_stdio(0);

	#ifdef PICHU_LOCAL_DEF
		chrono::steady_clock::time_point begin = std::chrono::steady_clock::now();
	#endif

	int t;
	cin >> t;

	while (t--) {
		string a, b;
		cin >> a >> b;

		string c;
		cin >> c;

		int na = a.size(), nb = b.size();

		a = "a" + a;
		b = "a" + b;
		c = "a" + c;

		for (int i = 0; i <= na; i++)
			for (int j = 0; j <= na + nb; j++) 
				dp[i][j] = 1e18;

		dp[0][0] = 0;

		for (int i = 0; i <= na; i++) {
			for (int j = 0; j <= na + nb; j++) {
				// i chars from a, j chars from c, minimum change
				// k chars from b
				int k = j - i;
				if (i > 0 && j > 0 && c[j] == a[i]) dp[i][j] = min(dp[i][j], dp[i - 1][j - 1]);
				if (j > 0 && k > 0 && c[j] == b[k]) dp[i][j] = min(dp[i][j], dp[i][j - 1]);
				if (i > 0 && j > 0) dp[i][j] = min(dp[i][j], dp[i - 1][j - 1] + 1);
				if (j > 0 && k > 0) dp[i][j] = min(dp[i][j], dp[i][j - 1] + 1);
			}
		}

		cout << dp[na][na + nb] << '\n';
	}		

	#ifdef PICHU_LOCAL_DEF
		chrono::steady_clock::time_point end = std::chrono::steady_clock::now();
		std::cout << std::endl;
		std::cout << "Time difference = " << chrono::duration_cast<chrono::milliseconds> (end - begin).count() << "[ms]" << std::endl;
	#endif
}
Problem: 2050E - Three Strings
Language: C++17 (GCC 7-32)

Previous submission (verdict: Runtime error on test 13):
#include <bits/stdc++.h>

#define int long long
 
#define fileopen(a, b) freopen(((std::string)a + ".inp").c_str(), "r", stdin); freopen(((std::string)b + ".out").c_str(), "w", stdout);
#define fileopen1(a) freopen(((std::string)a + ".inp").c_str(), "r", stdin); freopen(((std::string)a + ".out").c_str(), "w", stdout);
 
#ifdef PICHU_LOCAL_DEF
	#include <chrono>
#endif
 
using namespace std;

const int MAXN = 2e3 + 5;
int dp[MAXN][MAXN];

signed main() {
	cin.tie(0)->sync_with_stdio(0);

	#ifdef PICHU_LOCAL_DEF
		chrono::steady_clock::time_point begin = std::chrono::steady_clock::now();
	#endif

	int t;
	cin >> t;

	while (t--) {
		string a, b;
		cin >> a >> b;

		string c;
		cin >> c;

		int na = a.size(), nb = b.size();

		a = "x" + a;
		b = "x" + b;
		c = "x" + c;

		for (int i = 0; i <= na; i++)
			for (int j = 0; j <= na + nb; j++) 
				dp[i][j] = 1e18;

		dp[0][0] = 0;

		for (int i = 0; i <= na; i++) {
			for (int j = 0; j <= na + nb; j++) {
				// i chars from a, j chars from c, minimum change
				// k chars from b
				int k = j - i;
				if (i > 0 && j > 0 && c[j] == a[i]) dp[i][j] = min(dp[i][j], dp[i - 1][j - 1]);
				if (j > 0 && k > 0 && c[j] == b[k]) dp[i][j] = min(dp[i][j], dp[i][j - 1]);
				if (i > 0 && j > 0) dp[i][j] = min(dp[i][j], dp[i - 1][j - 1] + 1);
				if (j > 0 && k > 0) dp[i][j] = min(dp[i][j], dp[i][j - 1] + 1);
			}
		}

		cout << dp[na][na + nb] << '\n';
	}		

	#ifdef PICHU_LOCAL_DEF
		chrono::steady_clock::time_point end = std::chrono::steady_clock::now();
		std::cout << std::endl;
		std::cout << "Time difference = " << chrono::duration_cast<chrono::milliseconds> (end - begin).count() << "[ms]" << std::endl;
	#endif
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
#define int long long
int T,n,m,dp[1005][1005];
char a[1005],b[1005],c[2005];
#undef int
int main(){
	cin>>T;
	while(T--){
	scanf("%s",a+1),n=strlen(a+1);
	scanf("%s",b+1),m=strlen(b+1);
	scanf("%s",c+1);
	for(int i=1;i<=n;i++)dp[i][0]=dp[i-1][0]+(a[i]!=c[i]);
	for(int i=1;i<=m;i++)dp[0][i]=dp[0][i-1]+(b[i]!=c[i]);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
			dp[i][j]=min(dp[i-1][j]+(a[i]!=c[i+j]),
			             dp[i][j-1]+(b[j]!=c[i+j]));
	cout<<dp[n][m]<<endl;
	};
	return 0;
}
Problem: 2060D - Subtract Min Sort
Language: GNU C11


Submission (verdict: Wrong answer on test 2):
#include<stdio.h>
int main()
{
    int t,n;
    scanf("%d",&t);
    for(int i=0;i<t;i++)
       {
            scanf("%d",&n);
            int a[n];
            for(int j=0;j<n;j++)
                {
                    scanf("%d",&a[j]);

                }
                int c=0,d=0;
            for(int j=0;j<(n-1);j++)
                {
                    if(a[j+1]> a[j])
                    {
                        j++;
                        c++;
                    }  
                    d++;
                } 
                if(c==d)
                printf("YES\n");
                else 
                printf("NO\n");
        }
return 0;
}
Problem: 2060D - Subtract Min Sort
Language: GNU C11

Previous submission (verdict: Wrong answer on test 2):
#include<stdio.h>
int main()
{
    int t,n;
    scanf("%d",&t);
    for(int i=0;i<t;i++)
       {
            scanf("%d",&n);
            int a[n];
            for(int j=0;j<n;j++)
                {
                    scanf("%d",&a[j]);

                }
                int c=0,d=0;
            for(int j=0;j<(n-1);j++)
                {
                    if(a[j+1]> a[j])
                    {
                       a[j+1]-=a[j];
                        c++;
                    }  
                    d++;
                } 
                if(c==d)
                printf("YES\n");
                else 
                printf("NO\n");
        }
return 0;
}

Submission (verdict: Accepted):
#include<stdio.h>
int main()
{
    int t,n;
    scanf("%d",&t);
    for(int i=0;i<t;i++)
       {
            scanf("%d",&n);
            int a[n];
            for(int j=0;j<n;j++)
                {
                    scanf("%d",&a[j]);

                }
                int c=0,d=0;
            for(int j=0;j<(n-1);j++)
                {
                    if(a[j+1]>= a[j])
                    {
                       a[j+1]-=a[j];
                        c++;
                    }  
                    d++;
                } 
                if(c==d)
                printf("YES\n");
                else 
                printf("NO\n");
        }
return 0;
}
Problem: 2060D - Subtract Min Sort
Language: GNU C11

Previous submission (verdict: Wrong answer on test 2):
#include<stdio.h>
int main()
{
    int t,n;
    scanf("%d",&t);
    for(int i=0;i<t;i++)
       {
            scanf("%d",&n);
            int a[n];
            for(int j=0;j<n;j++)
                {
                    scanf("%d",&a[j]);

                }
                int c=0,d=0;
            for(int j=0;j<(n-1);j++)
                {
                    if(a[j+1]> a[j])
                    {
                        j++;
                        c++;
                    }  
                    d++;
                } 
                if(c==d)
                printf("YES\n");
                else 
                printf("NO\n");
        }
return 0;
}

Submission (verdict: Wrong answer on test 2):
#include<stdio.h>
int main()
{
    int t,n;
    scanf("%d",&t);
    for(int i=0;i<t;i++)
       {
            scanf("%d",&n);
            int a[n];
            for(int j=0;j<n;j++)
                {
                    scanf("%d",&a[j]);

                }
                int c=0,d=0;
            for(int j=0;j<(n-1);j++)
                {
                    if(a[j+1]> a[j])
                    {
                       a[j+1]-=a[j];
                        c++;
                    }  
                    d++;
                } 
                if(c==d)
                printf("YES\n");
                else 
                printf("NO\n");
        }
return 0;
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;

#define optimize() ios_base::sync_with_stdio(0); cin.tie(0)
#define ll long long
#define ff first
#define ss second
#define sz size()
#define pb push_back
#define vinput for(auto& x: v) cin >> x;
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define range(i,x,y) for(int i=x;i<y;i++)
#define back_range(i,x,y) for(int i=y-1;i>=x;i--)
#define mem(a,b) memset(a, b, sizeof(a) )

typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef vector<pii> vii;

// Debug..
#ifdef LOCAL
#include "debug2.h"
#else
#define dg(x...)
#endif

void Solve() {
    int n;
    cin >> n;
    vi v(n);
    vinput;
    
    for(int i=1; i<n; i+=2){
        if(v[i] == v[i-1]){
            v[i] = 0; 
            v[i-1] = 0;
        }
        if(v[i-1] > v[i] or (i == n-2 and v[i] > v[i+1])){
            cout << "NO\n";
            return;
        }
    }
    cout << "YES\n";
}

int main() {
    optimize();
    
    int t = 1;
    cin >> t;
    for(int i=1; i<=t; i++){
        //cout << "Case " << i << ": ";
        Solve();
    }
    
    return 0;
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;

#define optimize() ios_base::sync_with_stdio(0); cin.tie(0)
#define ll long long
#define ff first
#define ss second
#define sz size()
#define pb push_back
#define vinput for(auto& x: v) cin >> x;
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define range(i,x,y) for(int i=x;i<y;i++)
#define back_range(i,x,y) for(int i=y-1;i>=x;i--)
#define mem(a,b) memset(a, b, sizeof(a) )

typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef vector<pii> vii;

// Debug..
#ifdef LOCAL
#include "debug2.h"
#else
#define dg(x...)
#endif

void Solve() {
    int n;
    cin >> n;
    vi v(n);
    vinput;
    
    for(int i=1; i<n; i+=2){
        if(v[i] == v[i-1]){
            v[i] = 0; 
            v[i-1] = 0;
        }
        if(v[i-1] > v[i] or (i == n-2 and v[i] > v[i+1])){
            cout << "NO\n";
            return;
        }
    }
    cout << "YES\n";
}

int main() {
    optimize();
    
    int t = 1;
    cin >> t;
    for(int i=1; i<=t; i++){
        //cout << "Case " << i << ": ";
        Solve();
    }
    
    return 0;
}

Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;

#define optimize() ios_base::sync_with_stdio(0); cin.tie(0)
#define ll long long
#define ff first
#define ss second
#define sz size()
#define pb push_back
#define vinput for(auto& x: v) cin >> x;
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define range(i,x,y) for(int i=x;i<y;i++)
#define back_range(i,x,y) for(int i=y-1;i>=x;i--)
#define mem(a,b) memset(a, b, sizeof(a) )

typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef vector<pii> vii;

// Debug..
#ifdef LOCAL
#include "debug2.h"
#else
#define dg(x...)
#endif

void Solve() {
    int n;
    cin >> n;
    vi v(n);
    vinput;
    
    for(int i=1; i<n; i+=2){
        if(v[i-1] > v[i]){
            cout << "NO\n";
            return;
        }
        else{
            v[i] -= v[i-1];
            v[i-1] = 0;
        }
    }
    cout << "YES\n";
}

int main() {
    optimize();
    
    int t = 1;
    cin >> t;
    for(int i=1; i<=t; i++){
        //cout << "Case " << i << ": ";
        Solve();
    }
    
    return 0;
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;

#define optimize() ios_base::sync_with_stdio(0); cin.tie(0)
#define ll long long
#define ff first
#define ss second
#define sz size()
#define pb push_back
#define vinput for(auto& x: v) cin >> x;
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define range(i,x,y) for(int i=x;i<y;i++)
#define back_range(i,x,y) for(int i=y-1;i>=x;i--)
#define mem(a,b) memset(a, b, sizeof(a) )

typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef vector<pii> vii;

// Debug..
#ifdef LOCAL
#include "debug2.h"
#else
#define dg(x...)
#endif

void Solve() {
    int n;
    cin >> n;
    vi v(n);
    vinput;
    
    for(int i=1; i<n; i+=2){
        if(v[i-1] > v[i]){
            cout << "NO\n";
            return;
        }
        else{
            v[i] -= v[i-1];
            v[i-1] = 0;
        }
    }
    cout << "YES\n";
}

int main() {
    optimize();
    
    int t = 1;
    cin >> t;
    for(int i=1; i<=t; i++){
        //cout << "Case " << i << ": ";
        Solve();
    }
    
    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;

#define optimize() ios_base::sync_with_stdio(0); cin.tie(0)
#define ll long long
#define ff first
#define ss second
#define sz size()
#define pb push_back
#define vinput for(auto& x: v) cin >> x;
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define range(i,x,y) for(int i=x;i<y;i++)
#define back_range(i,x,y) for(int i=y-1;i>=x;i--)
#define mem(a,b) memset(a, b, sizeof(a) )

typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef vector<pii> vii;

// Debug..
#ifdef LOCAL
#include "debug2.h"
#else
#define dg(x...)
#endif

void Solve() {
    int n;
    cin >> n;
    vi v(n);
    vinput;
    
    for(int i=1; i<n; i++){
        if(v[i-1] > v[i]){
            cout << "NO\n";
            return;
        }
        else{
            v[i] -= v[i-1];
            v[i-1] = 0;
        }
    }
    if(is_sorted(all(v))){
        cout << "YES\n";
    }
    else cout << "NO\n";
}

int main() {
    optimize();
    
    int t = 1;
    cin >> t;
    for(int i=1; i<=t; i++){
        //cout << "Case " << i << ": ";
        Solve();
    }
    
    return 0;
}
Problem: 2057B - Gorilla and the Exam
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;

int main() {
    int t;
    cin >> t;
    while (t--) {
        int n, k;
        cin >> n >> k;
        vector<int> a(n);
        // unordered_map<int, int> freq;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }

        sort(a.begin(),a.end());
        int c=1;
        vector<int>cnt;
        
        for(int i=0;i<n-1;i++){
                if(a[i]==a[i+1]){
                    c++;
                }
                else{
                    cnt.push_back(c);
                    c=1;
                }
        }
        if(cnt.size()==1 || k>=n){
            cout<<1<<endl;
            continue;
        }
        sort(cnt.begin(),cnt.end());
        int ans = 0;
        for(int i=0;i<cnt.size();i++){
            if(k>0){
                k=k-cnt[i];
            }
            else{
                ans=cnt.size()-i;
                break;
            }
        }

        cout<<ans+1<<endl;
        
    }
    return 0;
}


Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;

int main() {
    int t;
    cin >> t;
    while (t--) {
        int n, k;
        cin >> n >> k;
        vector<int> a(n);
        // unordered_map<int, int> freq;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }

        sort(a.begin(),a.end());
        int c=1;
        vector<int>cnt;
        
        for(int i=0;i<n-1;i++){
                if(a[i]==a[i+1]){
                    c++;
                }
                else{
                    cnt.push_back(c);
                    c=1;
                }
        }
        cnt.push_back(c);
        if(cnt.size()==1 || k>=n){
            cout<<1<<endl;
            continue;
        }
        sort(cnt.begin(),cnt.end());
        int ans = cnt.size();
        for(int i=0;i<cnt.size();i++){
            if(k>=cnt[i]){
                k=k-cnt[i];
                ans--;
            }
            else{
                // ans=cnt.size()-i;
                break;
            }
        }

        cout<<ans<<endl;
        
    }
    return 0;
}
Problem: 2057B - Gorilla and the Exam
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;

int main()
{

    int t;
    cin >> t;
    while (t--)
    {
        int n, k;
        cin >> n >> k;
        vector<int> a(n);
        vector<int> ans;
        for (int i = 0; i < n; i++)
        {
            cin >> a[i];
        }
        unordered_map<int, int> mp;
        for (auto it : a)
        {
            mp[it]++;
        }

        int flag = 0, f1 = 1;

        priority_queue<int, vector<int>, greater<int>> q;
        for (auto it : mp)
        {
            q.push(it.second);
        }
        // cout << q.size();
        if (k >= n)
        {
            cout<<1<<endl;
            continue;
        }
        if(q.size()==1){
            cout<<1<<endl;
            continue;
        }
        else
        {
            while (k > 0 && !q.empty())
            {
                int s = q.top();
                q.pop();
                if (k >= 0)
                {
                    k = k - s;
                }
                else{
                    s=s-k;
                    k=0;
                    q.push(s);
                }
            }
        }
        
            cout << q.size() << endl;

    }
}

Submission (verdict: Time limit exceeded on test 14):
#include <bits/stdc++.h>
using namespace std;

int main() {
    int t;
    cin >> t;
    while (t--) {
        int n, k;
        cin >> n >> k;
        vector<int> a(n);
        unordered_map<int, int> mp;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            mp[a[i]]++;
        }

        priority_queue<int, vector<int>, greater<int>> q;
        for (auto it : mp) {
            q.push(it.second);
        }

        if (k >= n) {
            cout << 1 << endl;
            continue;
        }

        if (q.size() == 1) {
            cout << 1 << endl;
            continue;
        }

        while (k > 0 && !q.empty()) {
            int s = q.top();
            q.pop();
            if (k >= s) {
                k -= s;
            } else {
                q.push(s - k); 
                k = 0;
            }
        }
        cout << q.size() << endl;
    }
    return 0;
}
Problem: 2057B - Gorilla and the Exam
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;

int main()
{

    int t;
    cin >> t;
    while (t--)
    {
        int n, k;
        cin >> n >> k;
        vector<int> a(n);
        vector<int> ans;
        for (int i = 0; i < n; i++)
        {
            cin >> a[i];
        }
        unordered_map<int, int> mp;
        for (auto it : a)
        {
            mp[it]++;
        }

        int flag = 0, f1 = 1;

        priority_queue<int, vector<int>, greater<int>> q;
        for (auto it : mp)
        {
            q.push(it.second);
        }
        // cout << q.size();
        if (k >= n)
        {
            cout<<1<<endl;
            continue;
        }
        if(q.size()==1){
            cout<<1<<endl;
            continue;
        }
        else
        {
            while (k > 0 && !q.empty())
            {
                int s = q.top();
                q.pop();
                if (k >= 0)
                {
                    k = k - s;
                }
                else{
                    s=s-k;
                    k=0;
                    q.push(s);
                }
            }
        }
        
            cout << q.size() << endl;

    }
}
Problem: 2057B - Gorilla and the Exam
Language: C++17 (GCC 7-32)

Previous submission (verdict: Time limit exceeded on test 14):
#include <bits/stdc++.h>
using namespace std;

int main() {
    int t;
    cin >> t;
    while (t--) {
        int n, k;
        cin >> n >> k;
        vector<int> a(n);
        unordered_map<int, int> mp;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            mp[a[i]]++;
        }

        priority_queue<int, vector<int>, greater<int>> q;
        for (auto it : mp) {
            q.push(it.second);
        }

        if (k >= n) {
            cout << 1 << endl;
            continue;
        }

        if (q.size() == 1) {
            cout << 1 << endl;
            continue;
        }

        while (k > 0 && !q.empty()) {
            int s = q.top();
            q.pop();
            if (k >= s) {
                k -= s;
            } else {
                q.push(s - k); 
                k = 0;
            }
        }
        cout << q.size() << endl;
    }
    return 0;
}


Submission (verdict: Time limit exceeded on test 14):
#include <bits/stdc++.h>
using namespace std;

int main() {
    int t;
    cin >> t;
    while (t--) {
        int n, k;
        cin >> n >> k;
        vector<int> a(n);
        unordered_map<int, int> freq;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            freq[a[i]]++;
        }
        vector<int> frequencies;
        for (auto it : freq) {
            frequencies.push_back(it.second);
        }
        sort(frequencies.begin(), frequencies.end());

        if (k >= n) {
            cout << 1 << endl;
            continue;
        }

        int uniqueCount = frequencies.size();
        for (int f : frequencies) {
            if (k >= f) {
                k -= f;  // Use `k` to reduce this frequency
                uniqueCount--;  
            } else {
                break;  // No more reductions possible
            }
        }

        cout << uniqueCount << endl;
    }
    return 0;
}