dfs로 한칸씩 움직이면서 더하고 최고값을 구합니다.k==1 일때 양옆값을 더해서 ㅓ 모양을 더합니다. 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465#include using namespace std;// 181128 1:40int N, M;int dx[4] = {0, -1, 0, 1};int dy[4] = {1, 0, -1, 0};int map[500][500];int sel[3];int ans = -1; int chk(int x, int y) { if(x N-1 || y M-1) return 0; return 1;}void dfs(..
dfs로 경우를 만들고 합쳐지는 방향에 따라 인덱스의 시작과 증감방향을 다르게해서 계산합니다. 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150#in..
dfs 로 카메라의 회전 횟수 경우를 만들고 카메라종류마다 감시방향을 비트연산으로 구해 지정된 만큼 회전시켜 감시영역을 구합니다. 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130#include #include #include using namespace ..