Skip to content

Commit 64f9ce8

Browse files
committed
24511
1 parent 055cafa commit 64f9ce8

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

Baekjoon/Cpp/24511.cpp

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#include <bits/stdc++.h>
2+
3+
using namespace std;
4+
5+
int main()
6+
{
7+
ios::sync_with_stdio(false);
8+
cin.tie(nullptr);
9+
cout.tie(nullptr);
10+
vector<int> outputs;
11+
int n, m, i, b;
12+
cin >> n;
13+
int a[n];
14+
for (i = 0; i < n; i++)
15+
{
16+
cin >> a[i];
17+
}
18+
for (i = 0; i < n; i++)
19+
{
20+
cin >> b;
21+
if (a[i] == 0)
22+
{
23+
outputs.push_back(b);
24+
}
25+
}
26+
cin >> m;
27+
while (m--)
28+
{
29+
cin >> b;
30+
outputs.insert(outputs.begin(), b);
31+
cout << outputs.back() << " ";
32+
outputs.pop_back();
33+
}
34+
return 0;
35+
}

0 commit comments

Comments
 (0)