백준
-
백준 2448번 C++ 풀이백준 2018. 8. 29. 00:40
#include #include #include #include using namespace std; bool buffer[3100][6144]; void func(int x, int y, int length){ if (length == 3){ buffer[x][y] = true; buffer[x+1][y-1] = true; buffer[x+1][y+1] = true; buffer[x+2][y-2] = true; buffer[x+2][y-1] = true; buffer[x+2][y] = true; buffer[x+2][y+1] = true; buffer[x+2][y+2] = true; }else { func(x, y, length/2); func(x+length/2 , y+length/2, length/..
-
백준 1780번 C++ 풀이백준 2018. 8. 25. 09:53
#include #include #include using namespace std; struct Paper{ int minusOne; int zero; int plusOne; }; int buffer[2200][2200]; Paper cut(int startx, int starty, int length){ if (length == 1){ if (buffer[startx][starty]==1){ Paper paper; paper.minusOne = 0; paper.plusOne = 0; paper.zero = 1; return paper; }else if (buffer[startx][starty] == 0){ Paper paper; paper.minusOne = 1; paper.plusOne = 0; p..
-
백준 2156번 C++ 풀이백준 2018. 8. 24. 00:22
#include #include #include #include #include using namespace std; long wine[10001]; long didAteBefore[10001]; // i칸 , i-1칸 마심 long didAteBeforeBefore[10001]; //i칸, i-2칸 마심 long didAteBeforeBeforeBefore[10001]; //i칸, i-3칸 마심 int main() { cin.tie(NULL); ios::sync_with_stdio(false); int n; cin >> n; for (int i = 0; i> wine[i]; } didAteBefore[0] = wine[0]; didAteBeforeBefore[0] = wine[0]; didAteBefo..
-
백준 2579번 C++ 풀이백준 2018. 8. 19. 18:33
#include #include #include #include #include using namespace std; long long buffer[400]; long long previousStair[400]; long long previousTwoStair[400]; int main() { cin.tie(NULL); ios::sync_with_stdio(false); long long n; cin >> n; for (long long i = 0; i > buffer[i]; } previousStair[0] = buffer[0]; if (n > 0) { previousTwoStair[0] = 0; previousStair[1] = buffer[0] + buffer[1]; ..