포스트

[SWEA] 2112번: [모의 SW 역량테스트] 보호 필름 (Unrated) - C++ 풀이

[SWEA] 2112번: [모의 SW 역량테스트] 보호 필름 (Unrated) - C++ 풀이

문제 링크

소감

  • 가지치기가 중요한 문제.
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    
    vector<vector<int>> map(21, vector<int>(21, 0));
    vector<vector<int>> copy_map(21, vector<int>(21, 0));
    :
    :
    void dfs(int& ans, int idx, int cnt) {
      if (ans <= cnt || cnt > K) return;
    	
      // 검사
      if (idx == D) {
          if (test()) {
              if (ans > cnt)
                  ans = cnt;
          }
          return;
      }
    
이 기사는 저작권자의 CC BY 4.0 라이센스를 따릅니다.