Make Unreal REAL.
article thumbnail
Level 0. 캐릭터의 좌표

Level 0. 캐릭터의 좌표 #include #include #include using namespace std; vector solution(vector keyinput, vector board) { map mp = {{"left", {-1, 0}}, {"right", {1, 0}}, {"up", {0, 1}}, {"down", {0, -1}}}; vector answer = {0, 0}; vector limit = {board[0] / 2, board[1] / 2}; for (string key : keyinput) { answer[0] = max(-limit[0], min(answer[0] + mp[key][0], limit[0])); answer[1] = max(-limit[1], min(ans..

검색 태그