| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 843054 | Elvin_Fritl | Zalmoxis (BOI18_zalmoxis) | C++17 | 170 ms | 8824 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N = 505 , inf = 1e9 + 199;
int n,k;
vector<int>v;
void func(int ed)
{
if(ed == 0 || k == 0){
v.push_back(ed);
return;
}
k--;
func(ed - 1);
func(ed - 1);
}
int32_t main()
{
cin>>n>>k;
for(int i=0;i<n;i++){
int ed;
cin>>ed;
if(k > 0){
func(ed);
}
else{
v.push_back(ed);
}
}
for(int i=0;i<v.size();i++){
cout<<v[i]<<" ";
}
}
/*
1 1 2 2 3 3 4 4
1
*/
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
