본문 바로가기

전체 글412

2105 디저트 카페 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104#include #include using namespace std; int width;int place[30][30];int flag[30][30];int desert[105];int dx[5] = { 0, -1, 1, 1, -1 };int dy[5] = { 0, 1, 1, -1, -1 };int rst_max; void dfs(int y, i.. 2020. 3. 3.
2115 벌꿀채취 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114#include #include #include #include using namespace std; int w_total, w_part, cap_max=10;int box[15][15];int rst_max;int rst_pair_max;int cur_cap; void dfs(int y, i.. 2020. 3. 3.
4012 요리사 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980#include #include #include #include using namespace std; int num_food;int food[20][20] = { 0 };int teamA[20] = { 0 };long long min_abs; void combination(int idx, int depth);int sum_abs(); int main() { int t; scanf("%d", &t); for (int test = 1; test 2020. 3. 3.
시간초과) 5653 줄기세포 배양 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103#include #include #include #include using namespace std; int dead = -10000000;int cur[800][800];int power[800][800];int tmp_power[800][800];int cen_x = 400, cen_y = 400;int n, m, k; int bfs();void .. 2020. 3. 3.
5658 보물상자 비밀번호 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788#include #include #include #include #include using namespace std; vector num_list;queue arr;int n, k; void find_number(queue q);int hex_to_num(char c);int find_k_num(); int main() { int t; scanf("%d", &t); for (int test = 1; test 2020. 3. 2.
5656 벽돌깨기 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130#include #include #include #include #include using namespace std; int arr[20][20];int min_rst;int n, w, h; void dfs_.. 2020. 3. 2.
5644 무선충전 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156#include #include #include #include #i.. 2020. 3. 2.
1351 무한 수열 123456789101112131415161718192021222324252627282930313233343536373839404142#include #include using namespace std; long long dfs(long long num); long long p, q;map mp; int main() { long long n; scanf("%lld %lld %lld", &n, &p, &q); long long rst = dfs(n); printf("%lld", rst);} long long dfs(long long num) { if (num == 0) return 1; long long l = num / p; long long r = num / q; long long lv, rv; if .. 2020. 2. 29.
1789 수들의 합 12345678910111213141516#include int main() { long long s; scanf("%lld", &s); long long num = 1; while (1) { long long tmp = (num + 1) * num / 2; if (tmp > s) break; num++; } printf("%d", num-1);}Colored by Color Scriptercs 2020. 2. 29.
1357 뒤집힌 덧셈 1234567891011121314151617181920212223242526#include #include #include using namespace std; int rev(string str) { int len = str.length(); int rst = 0; for (int i = 0; i 2020. 2. 29.
2240 자두나무 123456789101112131415161718192021222324252627282930313233#include #include using namespace std; int main() { int t, w; scanf("%d %d", &t, &w); int plum[1001] = { 0 }; for (int i = 1; i 2020. 2. 28.
7579 앱 12345678910111213141516171819202122232425262728293031323334353637#include #include using namespace std; int main() { int n, m; scanf("%d %d", &n, &m); int app[101] = { 0 }; int cost[101] = { 0 }; for (int i = 1; i > 이 배열을 떠올리지 못했다.대체 어떻게 이런 생각을 해내는거지? 2. 어찌됐든, 저 발상을 가지고 시작하면 그나마 수월하다메모장에 하나씩 써보면, 결국 그 전의 어플리케이션 기록을 기반으로 dp를 갱신해야 된다는 것을 알게 된다 3. 또한, 매 턴마다 해당 어플을 비활성화 할 수도, 안 할 수도 있다 4. 위의 매커니즘을 모.. 2020. 2. 28.