Skip to content

Commit

Permalink
Merge pull request #24 from AlgoLeadMe/7-oesnuj
Browse files Browse the repository at this point in the history
7-oesnuj
  • Loading branch information
oesnuj authored Jul 6, 2024
2 parents 6326449 + c84a9f8 commit 1777dec
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions oesnuj/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
| 4์ฐจ์‹œ | 2024.04.06 | ์Šคํƒ | [์˜ฅ์ƒ ์ •์› ๊พธ๋ฏธ๊ธฐ](https://www.acmicpc.net/problem/6198) | [#14](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/14) |
| 5์ฐจ์‹œ | 2024.04.13 | ์ด๋ถ„ํƒ์ƒ‰ | [๋“ฃ๋ณด์žก](https://www.acmicpc.net/problem/1764) | [#20](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/20) |
| 6์ฐจ์‹œ | 2024.05.06 | ๊ธฐํ•˜ํ•™ | [์ •์‚ฌ๊ฐํ˜•](https://www.acmicpc.net/problem/1485) | [#22](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/22) |
| 7์ฐจ์‹œ | 2024.05.08 | ๋ฑ | [queuestack](https://www.acmicpc.net/problem/24511) | [#24](https://github.com/AlgoLeadMe/AlgoLeadMe-10/pull/24) |
---
35 changes: 35 additions & 0 deletions oesnuj/๋ฑ/24511.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <iostream>
#include <deque>
#include <vector>
using namespace std;

int main()
{
ios::sync_with_stdio(false); cin.tie(NULL);
int n;
cin >> n;
vector <int> dataStructure(n); //์Šคํ…์ธ์ง€ ํ์ธ์ง€ ์ž…๋ ฅ๋ฐ›๊ธฐ
for (auto& i : dataStructure){
cin >> i;
}

deque <int> queuestack;
for (int i = 0; i < n; i++)
{
int x;
cin >> x;
if (dataStructure.at(i) == 0) //ํ์ธ ๊ฒฝ์šฐ์—๋งŒ ์ฒ˜๋ฆฌ, ์Šคํƒ์€ ๋ฌด์กฐ๊ฑด ์ž…๋ ฅ๊ฐ’์ด ๋‚˜์˜ค๊ธฐ์— ์—†๋‹ค๊ณ  ๋ณด๋ฉด๋จ
queuestack.push_back(x);
}
int m;
cin >> m;
for (int i = 0; i < m; i++)
{
int x;
cin >> x;
queuestack.push_front(x);
cout << queuestack.back() << " ";
queuestack.pop_back();
}
return 0;
}

0 comments on commit 1777dec

Please sign in to comment.