백준 알고리즘/시뮬레이션43 백준 2979번 C++ #include using namespace std; const int MAX = 101; int fare[MAX]; int main(void) { int answer = 0; int a, b, c; cin >> a >> b >> c; for (int i = 0; i > arrive >> depart; for (int j = arrive; j < depart; j++) { fare[j] ++; } } for (int i = 1; i < MAX; i++) { if (fare[i] == 1) answer = answer + fare[i] * a; else if (fare[i] == 2) answer = answer + fare[i] * b; .. 2019. 8. 29. 백준 11559번 C++ #include #include #include #include #include #include using namespace std; const int MAX = 12; string map[MAX]; int visited[MAX][6]; struct Move { int x, y; }; Move mv[4] = { {1,0},{-1,0}, {0,1}, {0,-1} }; bool cmp(pair a, pair b){ if (a.first < b.first) return true; else if (a.first == b.first){ if (a.second < b.second) return true; return false; } return false; } int bfs() { int answer = 0; wh.. 2019. 8. 29. 백준 5397번 C++ #include #include #include #include using namespace std; int main(void) { int n; string s; cin >> n; for (int i = 0; i > s; stack answer,cache; for (int j = 0; j < s.length(); j++) { if (s[j] == '') { if (!cache.empty()) { answer.push(cache.top()); cache.pop(); } } else if (s[j] == '-') { if (!answer.empty()) answer.pop(); } else answer.push(s[j]); } while (!cache.empty()) { ans.. 2019. 8. 29. 백준 2161번 C++ #include #include using namespace std; int main(void) { int n; cin >> n; list num; for (int i = 1; i 2019. 8. 28. 이전 1 2 3 4 5 6 7 8 ··· 11 다음