#include #include using namespace std; int main(){ int count = 0; string str; cin>>str; for(int i=0; i
#include #include using namespace std; int main(){ dequedq; int n; cin >> n; for(int i=0; i> cmd; if(cmd == "push_front"){ int x; cin >> x; dq.push_front(x); } else if(cmd == "push_back"){ int x; cin >> x; dq.push_back(x); } else if(cmd == "pop_front"){ if(dq.empty()) cout
#include #include using namespace std; int main(){ int n, sum, digit; cin >> n; for(int i=1; i
#include #include using namespace std; int main() { vector N(6); for(int i = 0; i> N[i]; for(int x = -1000; x
#include #include #include using namespace std; #define MAX 101 int n, m; int recommend[MAX]; int main(){ cin >> n >> m; vector students(n); for (int i = 0; i > pick; recommend[pick]++; bool check = true; for (int j = 0; j < n; j++){ if (students[j].second == 0){ students[j].second = pick; students[j].first = i; check = false; break; } else if (students[j].second == pic..
#include #include using namespace std; int main(){ int students[31]={0}; int n; for(int i=1; i> n; students[n]=1; } for(int i=1; i
처음 시도한 풀이: 실패 #include #define MAX 10 using namespace std; int main(){ int R, C; cin >> R >> C; char map[MAX][MAX]={0}; char update_map[MAX][MAX]={0}; for(int i=1; i map[i][j]; } } int count = 0; for(int i=1; i