Compare commits

..

No commits in common. "6e9562d5cb3955e5814eb811add39c981a1ac5e2" and "929a5ed1888789ea7812f88930661b473fabc87a" have entirely different histories.

3 changed files with 1 additions and 46 deletions

View File

@ -5,6 +5,7 @@
using namespace std;
// 使用 long long 防止中间结果溢出
using ll = long long;
const int MOD = 1e9 + 7;

View File

@ -1,33 +0,0 @@
#include <algorithm>
#include <cstdint>
#include <cstdio>
#include <iostream>
#include <istream>
#include <map>
using ll = int64_t;
ll n;
std::map<ll, ll> r;
int main(){
std::iostream::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cin>>n;
for(ll i=1;i<=n;i++){
ll tmp;
std::cin>>tmp;
r[tmp]++;
}
auto idx = r.begin();
ll lessn=idx->second;
idx++;
ll ans=0;
for(;idx!=r.end();idx++){
ll candel = std::min(idx->second,lessn);
lessn-=candel;
lessn+=idx->second;
ans+=candel;
}
std::cout<<n-ans<<"\n";
}

View File

@ -1,13 +0,0 @@
#include <cstdint>
#include <cstdlib>
#include <vector>
using namespace std;
class Solution {
public:
using ll = int64_t;
int triangleNumber(vector<int>& nums) {
}
};
int main(){}