출처

https://swexpertacademy.com/main/code/problem/problemDetail.do?problemLevel=3&contestProbId=AV14hwZqABsCFAYD&categoryId=AV14hwZqABsCFAYD&categoryType=CODE&problemTitle=&orderBy=PASS_RATE&selectCodeLang=PYTHON&select-1=3&pageSize=10&pageIndex=2

과정

  1. 갯수를 세야하니 cnt를 0으로 한다.
  2. 세로 한줄마다 세야하므로 세로 수만큼 for문 쓰고 ans를 선언
  3. a[j][i]가 1이라면 ans에 추가
  4. a[j][i]가 2이고 ans에는 수가 들어있고 ans의 마지막 수가 1이라면 ans를 초기화하고 cnt에 1을 더해준다..
  5. 테스트 케이스 번호와 cnt를 출력한다.

정답 코드

태그: ,

카테고리:

업데이트: