Skip to content

Instantly share code, notes, and snippets.

@qjatn0120
Created March 23, 2023 14:15
Show Gist options
  • Save qjatn0120/51ddaaff93489f4771d49a89100fc73d to your computer and use it in GitHub Desktop.
Save qjatn0120/51ddaaff93489f4771d49a89100fc73d to your computer and use it in GitHub Desktop.
#ifdef DEBUG
#include "debug.h"
#endif // DEBUG
#ifndef DEBUG
template <typename T>
void debug(T &x){}
template <typename T>
void debug(T &x, int i, int j){}
#endif // DEBUG
#include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(nullptr), ios::sync_with_stdio(false);
int T;
cin >> T;
while(T--){
int n;
cin >> n;
vector <int> v(n);
for(int i = 0; i < n; i++) cin >> v[i];
int M = *min_element(v.begin(), v.end());
int ans = n;
for(int i = 0; i < n; i++){
if(v[i] == M) ans--;
}
cout << ans << "\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment