| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1290021 | MMihalev | Radio Towers (IOI22_towers) | C++20 | 304 ms | 17320 KiB |
#include<iostream>
#include<algorithm>
#include "towers.h"
#include <vector>
using namespace std;
int ma[2005][2005];
bool used[2005];
vector<int>h;
void init(int N, std::vector<int> H)
{
h=H;
for(int i=0;i<N;i++)
{
ma[i][i]=h[i];
for(int j=i+1;j<N;j++)
{
ma[i][j]=max(ma[i][j-1],h[j]);
}
}
}
int max_towers(int L, int R, int D)
{
bool ima=0;
for(int i=L;i<=R;i++)
{
for(int j=i+2;j<=R;j++)
{
if(ma[i+1][j-1]-D>=max(h[i],h[j]))
{
used[i]=1;
used[j]=1;
ima=1;
}
}
}
if(!ima)return 1;
int cnt=0;
for(int i=L;i<=R;i++)
{
cnt+=used[i];
}
return cnt;
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
