백준
-
백준 14619번 c++ 풀이백준 2019. 11. 24. 12:04
#include #include #include #include #include #include #include #include using namespace std; class IslandManager { public: IslandManager(int n) { this->n = n; this->bridgeBuffer = new bool*[n]; this->heightBuffer = new int[n]; for (auto i=0; ibridgeBuffer[i] = new bool[n] {false} ; } } void setHeight(int index, int height) { this->heightBuffer[index]=height; } void setBridge(int to, int from) { ..
-
백준 14612번 C++ 풀이백준 2019. 11. 21. 23:19
#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; struct PostIt { int tableNumber; int orderTime; PostIt(int tableNumber, int orderTime) { this->tableNumber = tableNumber; this->orderTime = orderTime; } }; inline bool compare(const PostIt& lhs, const PostIt& rhs) { if (lhs.orderTime == rhs.orderTime) { return..
-
백준 13413번 C++ 풀이백준 2019. 11. 9. 23:30
#include #include #include #include #include #include #include #include using namespace std; bool buffer[100][100]; int answer(bool origin[], bool goal[], int n) { int white = 0; int black = 0; for (auto i=0; i> t; while (t--) { int n; cin >> n; bool origin[n]; bool goal[n]; for (auto i=0; i> temp; origin[i] = temp == 'W'; } for (auto i=0; i> temp; goal[i] = temp == 'W'; } cout
-
백준 2096번 C++ 풀이백준 2019. 10. 29. 00:28
#include #include #include #include #include using namespace std; int main() { int n; cin >> n; int buffer[3] = {0, 0, 0}; int previousMinAnswer[3] = {0, 0, 0}; int minAnswer[3] = {0, 0, 0}; int previousMaxAnswer[3] = {0, 0, 0}; int maxAnswer[3] = {0, 0, 0}; for (auto i=0; i buffer[j]; } minAnswer[0] = buffer[0] + min(previousMinAnswer[0], previousMinAnswer[1]); minAnswer[1] = buffer[1] + min(mi..
-
백준 17070번 C++ 풀이백준 2019. 8. 30. 13:55
https://www.acmicpc.net/problem/17070 // // main.cpp // ps // // Created by MOZZET PC on 22/07/2019. // Copyright © 2019 Noondate. All rights reserved. // #include #include #include #include #include #include #include #include using namespace std; int n; int buffer[17][17]; int answer = 0; bool is_range(int x, int y) { return (0 n; for (auto x = 0; x buffer[x][y];..
-
백준 11559번 C++ 코드백준 2019. 8. 29. 22:43
#include #include #include #include #include #include #include #include #include #include #include using namespace std; char buffer[6][12]; bool is_visited[6][12]; int xxxx[4] = {0 , 0, -1, 1}; int yyyy[4] = {1, -1, 0, 0}; bool is_chain(int x, int y) { if (is_visited[x][y]) { return false; } if (buffer[x][y] == '.') { return false; } is_visited[x][y] = true; int chain = 1; auto color = buffer[x]..
-
백준 2468번 C++ 풀이백준 2018. 11. 25. 23:29
#include #include #include using namespace std; int delta[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}}; bool isVisited[101][101]; int buffer[101][101]; int main() { cin.tie(NULL); ios::sync_with_stdio(false); int n; cin >> n; for (auto i=0; i buffer[i][j]; } } int answer = 0; for (auto height = 0; height