# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1158030 | SmuggingSpun | Advertisement 2 (JOI23_ho_t2) | C++20 | 225 ms | 27280 KiB |
#include<bits/stdc++.h>
#define taskname "B"
using namespace std;
template<class T>void maximize(T& a, T b){
if(a < b){
a = b;
}
}
const int lim = 5e5 + 5;
int n, X[lim], E[lim];
namespace sub1{
void solve(){
map<int, bool>cnt;
for(int i = 1; i <= n; i++){
cnt[X[i]] = true;
}
cout << cnt.size();
}
}
namespace sub23{
void solve(){
map<int, int>repu;
for(int i = 1; i <= n; i++){
maximize(repu[X[i]], E[i]);
}
n = repu.size();
vector<pair<int, int>>vertex;
for(pair<const int, int>& it : repu){
vertex.emplace_back(it);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |