«integer» etiketlenmiş sorular

Tamsayıların manipülasyonunu içeren zorluklar için.

8
Phi üçgeni çiz
Açıklama: Temel olarak, yapmanız gereken bu Euler'nin totient fonksiyonunun adı phi'dir. Phi'yi hesaplamaya çalışalım (8) İlk olarak, 0 veya altı hariç, 8 ve altındaki tüm sayıları listeleyin 8 7 6 5 4 3 2 1 Şimdi hangi sayıların 8 ile bir faktörü paylaşmadığını (1 sayılmaz) bulun ve yerine a #yerleştirin. …

8
Tamsayılardan değişken sayıda bite iki yönlü eşleme
Değişken bit sayısı, 0 veya daha fazla bitlik bir dizidir. Yani [0, 1]bit değişken sayıdır, ama böyledir []. Negatif olmayan bir tamsayı verildiğinde, her tamsayı bir dizi ile bire bir (iki yönlü) eşleme olacak şekilde değişken sayıda bit döndüren bir işlev veya program yazın. Bu tür eşlemelerin sonsuz bir miktarı …

9
Uzayda ve Zamanda
Giriş: Üç uzay boyutları için: Genelde biz genellikle dört boyutun konuşmak x, yve z; ve bir kez boyut. Ancak bu meydan uğruna, biz de üçe zaman boyutunu ayıracağız: past, present, ve future. Giriş: İki giriş listesi. Biri tamsayı x,y,zkoordinatları, diğeri tamsayı yıl içerir. Çıktı: Seçtiğiniz dört farklı ve sabit çıkıştan …

7
Kimin komşuları düşmanca?
Giriş Bu zorluğun amaçları doğrultusunda, bir elemanının komşularını bir kare matris ( ) hemen çapraz, yatay veya dikey olarak bitişik olan tüm girişleri olarak tanımlayacağız. (yani , etrafını sarmadan " kuşatırlar).A E = A i , j A EEEEbirbirAE= Ai , j,E=birben,jE=A_{i,j}birbirAEEE EEE Pedallar için, matix için nin komşularının resmi …

6
Tatmin edici bir sayı mı?
bu sohbet sohbetinden ilham aldı Bir tatmin sayı olan ondalık gösterimi formda olan bir sayıdır abx, aşağıdaki özelliklere sahip,: xen uzun sondaki yinelenen sonek veya sonunda hiç yineleme yoksa son basamaktır ( 123333-> 3333, 545656-> 5656, 123-> 3) bx( 123333-> 2, 55545656-> 4) öncesindeki tek rakamdır akalan önek ( 123333-> …

3
Tam sayı ve belirgin kelime arasında eşleme
amaç Buradaki fikir, 32 bitlik bir tamsayıyı maksimum 9 karakterlik belirgin bir kelimeye / bu kelimeden eşlemek için gerekli kodu sağlamaktır. Bu, örneğin bir seri numarasını hatırlamayı kolaylaştırmak veya bir form yazmak için yararlı olabilir. Hem bir tamsayıyı karşılık gelen kelimeye çevirme hem de bir kelimeyi karşılık gelen tam sayıya …

6
N bazında palindrom olan sayılar
Negatif olmayan bir tamsayı göz önüne alındığında , tabanın olabileceği tam olarak farklı bazlarda palindrom n >= 0olan tamsayı dizisini sonsuza kadar çıkar .x_i >= 3nb2 <= b <= x_i-2 Bu temelde OEIS A126071'in tersidir , burada bu dizideki hangi indekslerin değeri vardır n. Biraz farklı, çünkü değiştirdim, böylece üsleri …
10 code-golf  sequence  base-conversion  palindrome  code-golf  array-manipulation  matrix  code-golf  string  ascii-art  code-golf  ascii-art  physics  code-golf  number  sequence  fibonacci  code-golf  ascii-art  packing  code-golf  string  hexadecimal  code-challenge  restricted-source  decision-problem  binary  code-golf  code-golf  code-golf  stack-exchange-api  code-golf  string  parsing  generation  data-structures  code-golf  kolmogorov-complexity  graphical-output  code-golf  array-manipulation  integer  generation  data-structures  code-golf  number  random  probability-theory  king-of-the-hill  java  minesweeper  code-golf  string  kolmogorov-complexity  animation  code-golf  string  code-golf  code-golf  quine  code-golf  internet  code-golf  arithmetic  base-conversion 

25
Göreli hızı hesapla
Olarak özel görelilik , ters yönde hareket eden başka bir nesne için bir hareketli nesne göreli hızı, aşağıdaki formül ile verilir: s = v + u1 + v u / c2.s=v+u1+vu/c2.\begin{align}s = \frac{v+u}{1+vu/c^2}.\end{align} s = ( v + u ) / ( 1 + v * u / c ^ …

24
Çarpımsal undelta
Şimdi değerlerin "çarpımsal deltalarını" tanımlayalım olarak:[a0,⋯aN,][a0,⋯aN,][\; a_0, \cdots a_N, \;] [a1/a0,⋯,ai+1/ai,⋯,aN/aN−1][a1/a0,⋯,ai+1/ai,⋯,aN/aN−1] [\; a_1 / a_0, \cdots, a_{i+1} / a_i, \cdots, a_N / a_{N-1} \;] Ters işlem - yani "çarpımsal undelta" - yukarıdaki işlem verilen değerlerle sonuçlanacak şekilde değerler döndürür. Misal Verilen değerler " çarpma undelta " işlemine genel bir çözüm …

2
Powder Toy'da golf için ipuçları
Bu ile eğlenin, Toz Oyuncak özellikle filtre mantığı ile golf için ilginç bir meydan okuma. TPT'yi zorlaştıran şey, bir probleme yaklaşmanın birçok çok yoludur: Should I use Cellular Automaton rules, SWCH logic, Filt logic, subframe filt logic, and/or wall logic? Gibi, TPT golf ipuçları için bir yer oldukça yararlı olacaktır, …
9 code-golf  tips  the-powder-toy  code-golf  number  array-manipulation  integer  code-golf  string  decision-problem  boggle  code-golf  array-manipulation  average  code-golf  math  code-golf  decision-problem  restricted-source  code-golf  code-golf  math  primes  code-golf  random  code-golf  tips  perl  code-golf  string  parsing  code-golf  math  number  decision-problem  code-golf  math  number  code-golf  string  alphabet  code-golf  math  geometry  code-golf  interpreter  brainfuck  code-golf  code-golf  decision-problem  boggle  code-golf  math  number  sequence  code-golf  math  code-golf  ascii-art  code-challenge  restricted-source  quine  code-golf  math  decision-problem  number-theory  primes  code-golf  ascii-art  code-golf  integer  graph-theory  chess  code-golf  math  interpreter  code-golf  code-golf  code-golf  ascii-art  code-golf  arithmetic  number-theory  code-golf  string  kolmogorov-complexity  code-golf  string  decision-problem  code-golf  primes  factoring  encode  code-golf  decision-problem  code-golf  geometry  grid  code-golf  quine  code-golf  matrix  code-golf  matrix  code-golf  code-golf  number  array-manipulation  code-golf  array-manipulation  sorting  code-golf  matrix  code-golf  brain-flak 

7
Bir tren etiketli bir köprüyü geçiyor
Birleştirilmiş pozitif tamsayıların rakamları ile etiketlenmiş karolar tarafından oluşturulan B uzunluğunda bir köprü düşünün . Örneğin, B 41 olsaydı, şöyle olurdu: ----------------------------------------- 12345678910111213141516171819202122232425 Şimdi köprüyü geçen T uzunluğunda bir tren hayal edin . Trenin en sol noktası X konumunda başlar (1 endeksli). Sorunu daha iyi anlamak için, B = 41, …

17
Asal çarpanlara ayırmada temeller
PPCG'de bir başka asal zorluğun geldiğini gördüm ve bana bazı asalları seviyorum. Sonra tanıtım metnini yanlış okudum ve buradaki yaratıcı beyinlerin ne bulduğunu merak ettim. Ortaya çıkan sorunun önemsiz olduğu ortaya çıktı, ama aynı soru okuduğum soru için de doğru mu merak ediyorum: 6, 2 ^ 1 * 3 ^ …

7
Sahte sahte Golf!
Giriş / Arka Plan Bir de son tartışmada yer kripto sohbet Birlikte / yardım görüşmek üzere meydan Fermat asallık testi ve Carmichael numaraları. Bu test a^(p-1) mod p==1her zaman primler için geçerli olacak p, ancak her zaman kompozitler için geçerli olmayan öncüllere dayanmaktadır . Bir dizi kendisi için: Artık bir …
9 code-golf  math  sequence  number-theory  primes  code-golf  string  code-golf  math  combinatorics  permutations  restricted-complexity  code-golf  array-manipulation  code-golf  number  sequence  code-golf  number  sequence  code-golf  binary-matrix  code-golf  math  tips  javascript  algorithm  code-golf  string  code-golf  number  sequence  code-golf  math  arithmetic  parsing  code-golf  number  sequence  primes  code-golf  string  ascii-art  geometry  integer  code-golf  geometry  code-golf  number  array-manipulation  code-golf  math  geometry  code-golf  number  sequence  arithmetic  integer  code-golf  string  kolmogorov-complexity  code-golf  number  code-golf  number  chess  code-golf  sequence  decision-problem  subsequence  code-golf  math  number  primes  code-golf  primes  permutations  code-golf  integer  probability-theory  statistics  code-golf  string  code-golf  sequence  decision-problem  parsing  board-game  code-golf  binary  graph-theory  code-golf  board-game  classification  tic-tac-toe  code-golf  ascii-art  polyglot  code-golf  date  code-golf  geometry 

13
Expand Karşılaştırma Zincirleri
Çoğu dilden farklı a<b<colarak Python , boole a<bile karşılaştırmanın aksine, aslında üç sayıyı karşılaştırarak matematikte olduğu gibi değerlendirir c. Bunu C (ve diğerleri) yazmanın doğru yolu olurdu a<b && b<c. Bu meydan okumada, göreviniz keyfi uzunluklardaki bu tür karşılaştırma zincirlerini Python / sezgisel sunumdan diğer dillerde nasıl yazılacağına genişletmektir. Özellikler …
9 code-golf  parsing  conversion  syntax  code-golf  sequence  primes  code-challenge  geometry  optimization  code-golf  graph-theory  code-golf  number-theory  primes  integer  code-golf  source-layout  cops-and-robbers  code-golf  source-layout  cops-and-robbers  code-golf  sequence  primes  integer  code-golf  math  number-theory  primes  rational-numbers  code-golf  math  sequence  number-theory  primes  code-golf  string  code-golf  math  combinatorics  permutations  restricted-complexity  code-golf  array-manipulation  code-golf  number  sequence  code-golf  number  sequence  code-golf  binary-matrix  code-golf  math  tips  javascript  algorithm  code-golf  string  code-golf  number  sequence  code-golf  math  arithmetic  parsing  code-golf  number  sequence  primes  code-golf  string  ascii-art  geometry  integer  code-golf  geometry  code-golf  number  array-manipulation  code-golf  math  geometry  code-golf  number  sequence  arithmetic  integer  code-golf  string  kolmogorov-complexity  code-golf  number  code-golf  number  chess  code-golf  sequence  decision-problem  subsequence  code-golf  math  number  primes  code-golf  primes  permutations  code-golf  integer  probability-theory  statistics  code-golf  string  code-golf  sequence  decision-problem  parsing  board-game  code-golf  binary  graph-theory  code-golf  board-game  classification  tic-tac-toe  code-golf  ascii-art  polyglot  code-golf  date  code-golf  geometry 

30
İnt girişi n verildiğinde, çıktı n * ters çevrilmiş (n)
Bir tam sayı verildiğinde n, çıktı alınn * reversed(n) reversed(n)reverserakamları ile elde ettiğiniz sayıdır n. reverse(512) = 215 reverse(1) = 1 reverse(101) = 101 >>>>>>>> func(5) = 5*5 = 25 func(12) = 12*21 = 252 func(11) = 11*11 = 121 func(659) = 659*956 = 630004 En kısa kod kazanır! Liderler …
9 code-golf  math  arithmetic  code-golf  math  integer  code-golf  arithmetic  integer  code-golf  sequence  base-conversion  palindrome  code-golf  math  primes  integer  code-golf  parsing  conversion  syntax  code-golf  sequence  primes  code-challenge  geometry  optimization  code-golf  graph-theory  code-golf  number-theory  primes  integer  code-golf  source-layout  cops-and-robbers  code-golf  source-layout  cops-and-robbers  code-golf  sequence  primes  integer  code-golf  math  number-theory  primes  rational-numbers  code-golf  math  sequence  number-theory  primes  code-golf  string  code-golf  math  combinatorics  permutations  restricted-complexity  code-golf  array-manipulation  code-golf  number  sequence  code-golf  number  sequence  code-golf  binary-matrix  code-golf  math  tips  javascript  algorithm  code-golf  string  code-golf  number  sequence  code-golf  math  arithmetic  parsing  code-golf  number  sequence  primes  code-golf  string  ascii-art  geometry  integer  code-golf  geometry  code-golf  number  array-manipulation  code-golf  math  geometry  code-golf  number  sequence  arithmetic  integer  code-golf  string  kolmogorov-complexity  code-golf  number  code-golf  number  chess  code-golf  sequence  decision-problem  subsequence  code-golf  math  number  primes  code-golf  primes  permutations  code-golf  integer  probability-theory  statistics  code-golf  string  code-golf  sequence  decision-problem  parsing  board-game  code-golf  binary  graph-theory  code-golf  board-game  classification  tic-tac-toe  code-golf  ascii-art  polyglot  code-golf  date  code-golf  geometry 

Sitemizi kullandığınızda şunları okuyup anladığınızı kabul etmiş olursunuz: Çerez Politikası ve Gizlilik Politikası.
Licensed under cc by-sa 3.0 with attribution required.