회전하는 큐
[실3] 1021 - 회전하는 큐
#include #include #include #include using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0), cout.tie(0); int s, n, cnt = 0; cin >> s >> n; deque dq; for (int i = 1; i > num; for (int i = 0; i < s; i++) { if (dq[i] == num) { idx = i; break; } } for (int i = 0; i < dq.size(); i++) { if (dq.front() == num) { dq.pop_front(); break; } if (idx < dq.size() / 2 + 1) { dq.push_back(dq..