We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 055cafa commit 64f9ce8Copy full SHA for 64f9ce8
Baekjoon/Cpp/24511.cpp
@@ -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
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
30
+ outputs.insert(outputs.begin(), b);
31
+ cout << outputs.back() << " ";
32
+ outputs.pop_back();
33
34
+ return 0;
35
+}
0 commit comments