| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1339881 | ninstroyer | 코끼리 (Dancing Elephants) (IOI11_elephants) | C++20 | 9090 ms | 1860 KiB |
#include<bits/stdc++.h>
#include "elephants.h"
using namespace std;
int n,l;
set<pair<int,int>> cameras, elephants;
void init(int N, int L, int X[])
{
n = N;
l = L;
for(int i = 0; i < n; i++)
{
elephants.insert({X[i],i});
}
int last = -1;
for(auto elephant : elephants)
{
auto [u,i] = elephant;
if(u>last) cameras.insert({u,u+l}),last=u+l;
}
}
int update(int i, int y)
{
for(auto elephant : elephants)
{
auto [u,idx] = elephant;
if(idx==i)
{
elephants.erase({u,idx});
elephants.insert({y,i});
break;
}
}
int last=-1;
cameras.clear();
for(auto elephant : elephants)
{
auto [u,idx] = elephant;
if(u>last) cameras.insert({u,u+l}),last=u+l;
}
return cameras.size();
}
| # | 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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
