수다닷컴

  • 해외여행
    • 괌
    • 태국
    • 유럽
    • 일본
    • 필리핀
    • 미국
    • 중국
    • 기타여행
    • 싱가폴
  • 건강
    • 다이어트
    • 당뇨
    • 헬스
    • 건강음식
    • 건강기타
  • 컴퓨터
    • 프로그램 개발일반
    • C언어
    • 비주얼베이직
  • 결혼생활
    • 출산/육아
    • 결혼준비
    • 엄마이야기방
  • 일상생활
    • 면접
    • 취업
    • 진로선택
  • 교육
    • 교육일반
    • 아이교육
    • 토익
    • 해외연수
    • 영어
  • 취미생활
    • 음악
    • 자전거
    • 수영
    • 바이크
    • 축구
  • 기타
    • 강아지
    • 제주도여행
    • 국내여행
    • 기타일상
    • 애플
    • 휴대폰관련
  • 프로그램 개발일반
  • C언어
  • 비주얼베이직

CCCSENIOR2009년 문제 2번 질문입니다.

똥덩어리

2023.04.01

cccsenior2009년 문제 2번 질문입니다.요약할 수가 없네요..질문 내용 : = =
problem s2: the lights going on and off
problem description
for your birthday, you have been given a grid of r (1 r 30) rows of lights, with each row
containing l (1  l 8) lights. lights can be in one of two states: on or off. for this question,
the topmost row is row r, and the bottom-most row is row 1. also, beside all rows except the
topmost row (row r), there is a button which can be pushed.
pushing the button beside row k (1  k r) will peform an “exclusive-or” operation on each
light of row k, which is described below. consider column i in row k, where 1  i  l. if the
lights in column i of row k and column i of row k + 1 are both the same (i.e., both on, or both
off), then pushing the button beside row k will cause the light in column i of row k to be off. if the
lights in column i of row k and column i of row k + 1 are different (i.e., one is on, and the other is
off), then pushing the button beside row k will cause the light in column i of row k to be on. an
example is shown below, for l = 4:
column numbers 1 2 3 4
row k + 1 on on off off
row k before button pushed on off on off
row k after button pushed off on on off
you are told which lights are initially on and which are initially off. you must calculate how many
different light patterns are possible for the bottom row by any sequence of button pushes.
input description
the first line of input will contain the integer r, the number of rows. the second line of input
will contain the integer l, the number of lights per row. the next r lines of input will contain
l integers, where the integer will either be 0 (to indicate “off”) or 1 (to indicate ”on”). pairs of
consecutive integers will be separated by one space character. these r lines will be given in topdown
order: that is, the third line of input will be the description of row r, the fourth line will be
r 􀀀 1, and so on, until the last line describes the bottom row.
output description
output the number of possible light patterns of the bottom row.
sample input
4
3
0 0 1
0 1 1
1 0 1
0 0 1
output for sample input
4

간단히 문제를 설명해드리자면.
r*l의 전구셋트가 있습니다.
1 r 30, 1 = l 8 이구요.
즉, r은 l만큼의 전구가 몇개있다 그거구요.
l은 한 줄에 전구 몇개다 입니다.
여기서, row 1은 제일 아래있는 줄을 뜻합니다.
row r이 제일 위에있는 줄을 뜻합니다.

여기서, row r을 제외한 나머지 row에는 모두 버튼이 있는데, 이 버튼을 누르면
row k를 눌럿을 시, row k = (row k) xor (row k+1) 이 연산을 수행하고, row k에 들어가는 값이 전구 패턴의 하나가 됩니다.

이렇게해서.. 순서에 상관없이, 중복돼지 않게 전구 패턴이 총 몇가지 경우의 수가 있는지 찾는 프로그램입니다.

도와주세요.. ㅜ
막막하네요..

신청하기





COMMENT

댓글을 입력해주세요. 비속어와 욕설은 삼가해주세요.

번호 제 목 글쓴이 날짜
2694532 네트워크에 관하여... (4) 황소자리 2025-05-12
2694503 프로그램 연산 후 바로 종료되는 현상 (6) Judicious 2025-05-11
2694450 while문질문입니다. (1) 허리품 2025-05-11
2694420 C언어 질문할게요(유니코드,자료형,버퍼,캐스트연산자) 은새 2025-05-11
2694370 내일까진데 함수호출 제발 도와주세요!!!!!!!!!11 들찬 2025-05-10
2694339 putchar()의 괄호 안에 int c=10;로 전에 선언된 c를 넣으면 안되는 이유에서 제가 생각한 것이 그 이유가 되는지 확인하고 싶습니다. (3) 미르 2025-05-10
2694316 이 코드 어디가 잘못되었는지 고수분들 ㅠㅠ (2) 나빛 2025-05-10
2694285 언어 공부하는 과정 좀 추천해주세요! (1) 아빠몬 2025-05-09
2694258 카운터.. 질문입니다. (4) 하늘빛눈망울 2025-05-09
2694229 단순한 질문이요 (8) 여름 2025-05-09
2694202 용돈을 가지고 할 수 있는 일을 여러가지로 출력하는 방법 좀 알려주세요! (2) 미나 2025-05-09
2694145 화면깜빡임을 없애고 싶은데요... (1) 어서와 2025-05-08
2694069 unsigned 질문입니다. 힘차 2025-05-07
2694012 전공 비전공자 개발자 (10) 말글 2025-05-07
2693984 오버로딩이 무엇인가요? (2) 헛매질 2025-05-07
2693956 PlaySound재생이 안됩니다!(C에 음악넣기) 지존 2025-05-06
2693928 &와 *의 사용에 관한 명확한 이해 제나 2025-05-06
2693903 반복문 설명좀요 ㅠㅠ (2) 란새 2025-05-06
2693869 stdio.h 는 왜 쓰는건가요? (1) 큰꽃들 2025-05-06
2693842 포인터 변수의 주소값끼리 더하는 것에 대해서 질문드립니다. (1) 진솔 2025-05-05
<<  이전  1 2 3 4 5 6 7 8 9 10  다음  >>

수다닷컴 | 여러분과 함께하는 수다토크 커뮤니티 수다닷컴에 오신것을 환영합니다.
사업자등록번호 : 117-07-92748 상호 : 진달래여행사 대표자 : 명현재 서울시 강서구 방화동 890번지 푸르지오 107동 306호
copyright 2011 게시글 삭제 및 기타 문의 : clairacademy@naver.com