File tree 2 files changed +36
-0
lines changed
2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 8
8
| 4์ฐจ์ | 2024.04.06 | ์คํ | [ ์ฅ์ ์ ์ ๊พธ๋ฏธ๊ธฐ] ( https://www.acmicpc.net/problem/6198 ) | [ #14 ] ( https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/14 ) |
9
9
| 5์ฐจ์ | 2024.04.13 | ์ด๋ถํ์ | [ ๋ฃ๋ณด์ก] ( https://www.acmicpc.net/problem/1764 ) | [ #20 ] ( https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/20 ) |
10
10
| 6์ฐจ์ | 2024.05.06 | ๊ธฐํํ | [ ์ ์ฌ๊ฐํ] ( https://www.acmicpc.net/problem/1485 ) | [ #22 ] ( https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/22 ) |
11
+ | 7์ฐจ์ | 2024.05.08 | ์คํ, ํ, ๋ฑ | [ queuestack] ( https://www.acmicpc.net/problem/24511 ) | [ #24 ] ( https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/24 ) |
11
12
---
Original file line number Diff line number Diff line change
1
+ #include < iostream>
2
+ #include < deque>
3
+ #include < vector>
4
+ using namespace std ;
5
+
6
+ int main ()
7
+ {
8
+ ios::sync_with_stdio (false ); cin.tie (NULL );
9
+ int n;
10
+ cin >> n;
11
+ vector <int > dataStructure (n); // ์คํ
์ธ์ง ํ์ธ์ง ์
๋ ฅ๋ฐ๊ธฐ
12
+ for (auto & i : dataStructure){
13
+ cin >> i;
14
+ }
15
+
16
+ deque <int > queuestack;
17
+ for (int i = 0 ; i < n; i++)
18
+ {
19
+ int x;
20
+ cin >> x;
21
+ if (dataStructure.at (i) == 0 ) // ํ์ธ ๊ฒฝ์ฐ์๋ง ์ฒ๋ฆฌ, ์คํ์ ๋ฌด์กฐ๊ฑด ์
๋ ฅ๊ฐ์ด ๋์ค๊ธฐ์ ์๋ค๊ณ ๋ณด๋ฉด๋จ
22
+ queuestack.push_back (x);
23
+ }
24
+ int m;
25
+ cin >> m;
26
+ for (int i = 0 ; i < m; i++)
27
+ {
28
+ int x;
29
+ cin >> x;
30
+ queuestack.push_front (x);
31
+ cout << queuestack.back () << " " ;
32
+ queuestack.pop_back ();
33
+ }
34
+ return 0 ;
35
+ }
You canโt perform that action at this time.
0 commit comments