프로그래밍 퍼즐 및 코드 골프

퍼즐 애호가와 코드 골퍼들을위한 Q & A

23
ASCII 아트 팔각형
입력 integer가 주어지면 문자 n > 1로 구성된 측면 길이를 가진 ASCII 아트 팔각형을 출력하십시오 n. 아래 예를 참조하십시오. n=2 ## # # # # ## n=3 ### # # # # # # # # # # ### n=4 #### # # # # # # # # # …
22 code-golf  ascii-art  code-golf  geometry  code-golf  balanced-string  code-golf  cops-and-robbers  code-challenge  cops-and-robbers  code-golf  code-golf  random  cryptography  code-golf  array-manipulation  number  code-challenge  integer  code-golf  math  integer  code-golf  math  math  parsing  image-processing  test-battery  math  number  combinatorics  fastest-code  code-golf  code-golf  math  number-theory  rational-numbers  polynomials  code-golf  math  geometry  code-golf  code-golf  number-theory  primes  factoring  code-golf  restricted-source  code-golf  string  decision-problem  counting  code-golf  math  sequence  fibonacci  code-golf  array-manipulation  counting  code-golf  array-manipulation  number-theory  code-golf  array-manipulation  code-golf  random  code-golf  string  hexadecimal  code-golf  string  code-challenge  sorting  code-golf  number  floating-point  code-golf  sorting  code-golf  decision-problem  fibonacci  code-golf  number  combinatorics  code-golf  string  code-golf  math  code-golf  electrical-engineering  code-golf  javascript  code-golf  base-conversion  code-golf  array-manipulation  matrix  binary-matrix  code-golf  kolmogorov-complexity  python  perl  ruby  code-golf  number  code-golf  optimization  integer-partitions  code-golf  string  code-golf  ascii-art 

2
부분 집합 합계 주문
일련의 n양수가 2^n하위 집합을. 해당 부분 집합이 동일한 합계를 갖지 않으면 "nice"세트를 호출합니다. {2, 4, 5, 8}그런 멋진 세트 중 하나입니다. 부분 집합 중 동일한 합계를 가진 하위 집합이 없기 때문에 부분 집합을 합계로 정렬 할 수 있습니다. [{}, {2}, {4}, {5}, {2, 4}, {2, 5}, {8}, {4, 5}, {2, …

28
간단한 단어 래퍼 만들기
(참고 : 이것은 처음으로 코드 골프 질문이지만, 내가 알 수있는 한, 아무도 정확히 이것을하지 않았으므로 좋을 것입니다.) 당신의 임무는 문자열 s과 정수 를 취하고 n그 텍스트를 여러 줄로 감싸서 반환하거나 출력 하는 프로그램이나 함수를 만드는 것 입니다. 각 단어는 한 줄에 있어야합니다. 즉, 단어가 중간에 쪼개지지 않습니다. 각 줄은 더 …
22 code-golf  string  code-golf  string  parsing  apl  math  primes  integer  fastest-code  code-golf  math  primes  integer  code-golf  ascii-art  kolmogorov-complexity  code-golf  string  array-manipulation  code-golf  number  code-golf  sequence  code-golf  math  arithmetic  code-golf  date  conversion  code-golf  geometry  combinatorics  grid  code-golf  string  code-golf  counting  java  code-golf  chess  code-golf  path-finding  conversion  atomic-code-golf  logic-gates  code-golf  fibonacci  code-golf  ascii-art  fractal  code-golf  quine  code-golf  string  code-golf  array-manipulation  decision-problem  code-golf  quine  code-golf  code-challenge  array-manipulation  code-challenge  word-search  code-golf  binary  conversion  code-golf  code-golf  restricted-source  code-golf  kolmogorov-complexity  restricted-source  code-golf  kolmogorov-complexity  random  animation 

14
이것들은 어떤 숫자입니까?
숫자를 쓰는 동안 잠시 후 키보드에 Shift키가 눌려져 있고 차단 된 $%&문자 가 모두 같은 문자 라는 것을 알았 습니다 . 그리고 더 나쁜 것은 영어와 스페인어 키보드 레이아웃 간을 전환했기 때문에 각 숫자에 어떤 것을 사용했는지 알 수 없습니다. 도전 기호 문자가 포함 된 문자열이 주어지면 내가 쓴 숫자를 …

24
ogl-edocf 도전
입력 범위의 ASCII 문자로 구성된 비어 있지 않은 섞인 문자열 입니다.[ 32..126 ][32..126][32..126] 산출 입력 문자열에 연속적인 회전을 적용하여 출력을 얻습니다. [a-zA-Z]입력 문자열의 각 문자 ( )에 대해 왼쪽에서 오른쪽으로 : 문자가 대문자 인 경우 모든 문자를 왼쪽으로 한 위치 씩 회전 문자가 소문자 인 경우 오른쪽 앞의 한 위치 …
22 code-golf  string  code-golf  string  code-golf  string  parsing  brainfuck  code-challenge  python  hello-world  error-message  code-golf  string  code-golf  number  integer  counting  subsequence  code-golf  string  cipher  code-golf  array-manipulation  arithmetic  integer  matrix  code-golf  math  sequence  code-golf  restricted-source  pi  popularity-contest  cops-and-robbers  polyglot  popularity-contest  cops-and-robbers  polyglot  code-golf  file-system  king-of-the-hill  code-golf  number  sequence  integer  rational-numbers  string  code-challenge  source-layout  code-golf  ascii-art  king-of-the-hill  code-golf  array-manipulation  sorting  code-golf  string  code-golf  restricted-source  source-layout  tips  math  code-challenge  permutations  logic-gates  code-golf  number  random  integer  code-golf  math  code-golf  math  number  decision-problem  king-of-the-hill  python  board-game  code-challenge  brainfuck  busy-beaver  code-golf  number  cops-and-robbers  polyglot  obfuscation  answer-chaining  code-golf  number  integer  conversion  code-golf  string  parsing  code-golf  ascii-art  number  king-of-the-hill  javascript  code-golf  source-layout  radiation-hardening  code-golf  array-manipulation  matrix  code-golf  string  graph-theory  code-golf  array-manipulation  decision-problem  code-golf  string  ascii-art  code-golf  string  code-golf  array-manipulation 

8
단일 다트 득점
소개 다트가 다트 판에 놓이는 좌표를 지정하여 해당 다트의 점수를 반환하는 프로그램 또는 함수를 작성하십시오. 다트 좌표는 x,y다트 판의 중심에서 측정 된 밀리미터 정밀도 로 두 개의 정수로 제공됩니다 . 다트를 득점하는 방법 다트는 원형 보드에 다트를 던지는 게임입니다. 다트 판은 20 개의 동일한 크기의 "쐐기"로 나뉩니다. 상단에서 시작하여 시계 …
22 code-golf  game 

23
최소 동력 뿌리
숫자 n 의 최소 전력 반복 은 다음과 같이 정의됩니다.nnn MPI(n):=nmin(digits(n))MPI(n):=nmin(digits(n))\text{MPI}(n):=n^{\text{min}(\text{digits}(n))} 즉, nnn 은 n 의 가장 낮은 자릿수로 nnn . 예를 들어, MPI(32)=322=1024MPI(32)=322=1024\text{MPI}(32)=32^2=1024 및 MPI(1234)=12341=1234MPI(1234)=12341=1234\text{MPI}(1234)=1234^1=1234 입니다. 숫자 n 의 최소 제곱근 은 고정 점이 발견 될 때까지 MPI 를 반복적으로 적용하여 얻은 수로 정의됩니다 . 다음은 1에서 25 사이의 …

16
3x3 행렬의 역함수를 구합니다
도전 a, b, c, d, e, f, g, h, i제곱 행렬에 해당하는 입력으로 9 개의 숫자가 주어집니다 . M=⎛⎝⎜adgbehcfi⎞⎠⎟M=(abcdefghi)\mathbf{M} = \begin{pmatrix}a& b& c\\ d& e& f\\ g& h& i\end{pmatrix} 행렬의 역수 M−1M−1\mathbf{M}^{-1} 찾아 성분을 출력합니다. 역행렬 행렬 3의 3에 대한 역은 다음 방정식을 따릅니다. MM−1=M−1M=I=⎛⎝⎜100010001⎞⎠⎟MM−1=M−1M=I=(100010001)\mathbf{MM}^{-1} = \mathbf{M}^{-1}\mathbf{M} = \mathbf{I} = …

18
숫자의 RTA (Reverse-Then-Add) 근
RTA (reverse-then-add) 시퀀스는 숫자를 역방향에 추가하고 결과에 대해 프로세스를 반복하여 얻은 시퀀스입니다. 예를 들어 5+5=10⇒10+01=11⇒11+11=22⇒22+22=44⇒ ...5+5=10⇒10+01=11⇒11+11=22⇒22+22=44⇒ ... 5 + 5 = 10 \Rightarrow 10 + 01 = 11 \Rightarrow 11 + 11 = 22 \Rightarrow 22 + 22 = 44 \Rightarrow\text{ }... 따라서, 5의 RTA 서열은 10, 11, 22, 44, …
22 code-golf  math  number 

3
경로 및 낭비 시간
전제 그래서 최근에 나는 약 30 분 일찍 약속을 잡고 밖에서 기다렸다. 나는 또한 집 앞에 움직이지 않고 서 있으면 이상하게 보일 것이라고 결정했다. 따라서 나는 제한된 지역 내에서 빨리 걸어 가기로 결정했습니다. 나는 또한 내가 서클에서 걷기 시작하면 내가 배회하고 있다는 것을 분명히 할 것이라고 결론 지었다. 그래서 저는 …

9
말 그대로 CR과 LF를 가져 가라.
오래된 메모장을 축하 하기 위해 캐리지 리턴과 줄 바꿈을 오늘날 사용 된 것이 아니라 원래의 의미로 취급합니다. 인쇄 가능한 ASCII와 줄 바꿈 (␊; LF; esc \n; hex 0A; dec 10)과 캐리지 리턴 (␍; CR; esc \r; hex 0D; dec 13) 으로 구성된 문자열이 있으면 온라인 으로 시도 하여 인쇄 가능한 …


11
숫자 제품 순서
다음은 Bloomsburg University의 수학자 Paul Loomis가 발견 한 흥미로운 순서입니다. 에서 자신의 페이지에 이 순서에 : 정의 f(n) = f(n-1) + (the product of the nonzero digits of f(n-1)) f(0) = x와, x베이스 (10)에 기록 된 양의 정수로. 따라서로 시작 f(0)=1하면 다음과 같은 시퀀스가 ​​나타납니다. 1, 2, 4, 8, 16, …

17
월시 행렬 생성
월시 행렬은 광장 매트릭스의 특별한 종류 양자의 응용 프로그램 컴퓨팅 (아마 다른 곳에서하고 있지만, 나는 단지 양자 컴퓨팅에 대한 관심). 월시 행렬의 속성 치수는 우리가 그들을 호출, 여기에 2의 지수 이러한 행렬을 참조 할 수 있습니다, 따라서 2의 동일한 전력이다 W(0), W(1), W(2)... W(0)로 정의됩니다 [[1]]. 의 경우 n>0, W(n)외모가 …
22 code-golf  math  matrix 

30
2가없는 표시 번호
1부터 100까지 (순서대로) 숫자를 표시하지만 순서 2에는 숫자 2가 나타나지 않아야합니다. 예를 들어, 숫자 2 ( 2) 또는 23 ( 23)은 순서에 있지 않아야합니다. 다음은 줄 바꿈으로 숫자를 구분하는 예제 출력입니다. 1 3 4 5 6 7 8 9 10 11 13 14 15 16 17 18 19 30 31 …

당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.