본문 바로가기

한국으로74

[문제풀이] 14706번: 구간 합 최대 [문제풀이] 14706번: 구간 합 최대https://www.acmicpc.net/problem/14706 문제유형세그먼트 트리 Solution1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162#include #define MAXN 50000#define MAXT (50000*2*2)int N, Q; //원소의 갯수, 구간의 갯수int tree[MAXT];#define MAX(a,b) ((a > b) ? (a) : (b)) void update_new_data(int node, int s, int e, int idx, int d){ int m; if .. 2018. 7. 4.
[문제풀이] 7432번: 디스크 트리 [문제풀이] 7432번: 디스크 트리https://www.acmicpc.net/problem/7432 문제유형TRIE Solution123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109#include #include int N;typedef struct st{ int check; int isWord; struct st* next; struct st* child[80];}.. 2018. 7. 4.
[문제풀이] 5052번: 전화번호 목록 [문제풀이] 5052번: 전화번호 목록https://www.acmicpc.net/problem/5052 문제유형TRIE Solution123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111#include #include typedef struct tn{ int word; struct tn* child[10];}NODE;NODE root;char str[10001.. 2018. 7. 4.
[문제풀이] 6593번: 상범 빌딩 [문제풀이] 상범 빌딩https://www.acmicpc.net/problem/6593 문제유형BFS Solution123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135#include #define MAX 32#define CIR (.. 2018. 7. 4.