#include <bits/stdc++.h>
using namespace std;
int main()
{
// cout << "Hello world!" << endl;
long long n,c=0;
cin>>n;
long long a[n];
map<long long,long long>mp;
long long m=1e9+1;
for(int i=0;i<n;i++)
{
cin>>a[i];
mp[a[i]]++;
m=min(a[i],m);
}
for(auto i:mp)
{
if(i.first==m)
{
c++;
continue;
}
else
{
c+=i.first-m;
}
}
cout<<c<<endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
4 |
Incorrect |
12 ms |
676 KB |
Output isn't correct |
5 |
Incorrect |
18 ms |
872 KB |
Output isn't correct |
6 |
Incorrect |
60 ms |
4184 KB |
Output isn't correct |
7 |
Incorrect |
68 ms |
7220 KB |
Output isn't correct |