Domande taggate «number»

Questa sfida deve essere risolta usando, manipolando, accettando come input o producendo valori numerici.

13
Espandi catene di confronto
A differenza di molti linguaggi, Python valuta a<b<cin quanto sarebbe stato fatto nel campo della matematica, in realtà a confronto i tre numeri, al contrario di confrontare il booleano a<ba c. Il modo corretto di scrivere questo in C (e molti altri) sarebbe a<b && b<c. In questa sfida, il …
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
Dato un input int n, stampa n * invertito (n)
Dato un numero intero n, stampan * reversed(n) reversed(n)è il numero che ottieni quando hai reversele cifre di 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 Vince …
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 

14
In aumento, in diminuzione, nessuno o tutti?
Prendete due ingressi, un non-vettore vuoto / elenco contenente cifre 1e 2e una stringa (no, non si può prendere 0/1invece). La stringa sarà una delle seguenti (in minuscolo, esattamente come scritto sotto: increasing decreasing ones twos all none Se la stringa è ____, dovrai restituire gli indici ___: increasing... dove …

22
Genera segnale triangolare
Compito: Dato indice del campione, x, calcola il valore del campione f (x) dell'onda triangolare, con un periodo di 4 campioni e ampiezza 1. L'offset può essere negativo e il valore del campione può essere {0, 1, -1}. Casi test: -5 -> -1 -4 -> 0 -3 -> 1 -2 …

15
Implementa il metodo di Eulero
L'obiettivo di questa sfida è utilizzare il metodo di Eulero per approssimare la soluzione di un'equazione differenziale della forma f (n) (x) = c. † L'ingresso sarà una lista di interi in cui il n esimo valore rappresenta il valore di f (n) (0). Il primo numero intero è f …



2
Le 10.000 parole più comuni
Questa domanda è scritta perché "Thing Explainer" è divertente da leggere e mi ha dato un'idea. Scrivi "cose ​​che fanno fare al computer cose" che legge / prende un insieme di lettere, numeri e cose del genere "#%|?e ritorna True / 1se tutte le parole fanno parte di questo insieme …
9 code-golf  string  parsing  code-golf  array-manipulation  random  permutations  code-golf  string  code-golf  parsing  code-golf  string  quine  code-golf  string  parsing  comment  code-golf  string  counting  natural-language  code-golf  string  decision-problem  code-golf  math  code-challenge  metagolf  test-battery  code-golf  string  code-golf  math  number  arithmetic  source-layout  code-golf  number  primes  decision-problem  code-golf  math  arithmetic  code-golf  date  code-golf  string  cryptography  code-golf  code-golf  chess  board-game  code-golf  geometry  grid  puzzle-solver  set-partitions  code-golf  number  natural-language  code-golf  ascii-art  code-golf  math  code-golf  string  ascii-art  kolmogorov-complexity  code-golf  string  natural-language  code-golf  game  board-game  tic-tac-toe  code-golf  ascii-art  hexagonal-grid  code-golf  string  comment  code-golf  internet  code-golf  sorting  code-golf  kolmogorov-complexity  unicode  code-golf  tips  code-golf  string  natural-language  code-golf  string  kolmogorov-complexity  source-layout  hello-world  code-golf  string  kolmogorov-complexity  counting  natural-language  code-golf  random  quine  code-golf  string  math  bitwise  code-golf  permutations  code-golf  string  code-golf  arithmetic 

2
Taxi me alcuni numeri
I numeri di taxi o OEIS A011541 sono i numeri minimi che possono essere rappresentati come n diverse somme di due numeri interi a cubi positivi, per successive n . Avrai bisogno di stampare il n ° numero di taxi. Questo dovrebbe funzionare per qualsiasi n in teoria. Tuttavia, poiché …


4
gli intoccabili
Numeri intoccabili α Un numero intoccabile è un numero intero positivo che non può essere espresso come la somma di tutti i divisori propri di qualsiasi numero intero positivo (incluso il numero intoccabile stesso). Ad esempio, il numero 4 non è intoccabile in quanto è uguale alla somma dei divisori …

3
Quadrato dalle cifre con la somma più grande
Dovresti scrivere un programma o una funzione che riceve un elenco di cifre come input e output o restituisce la somma più grande ottenibile mettendo queste cifre in un quadrato. L'input conterrà sempre un numero quadrato di cifre. 9 1 2 3 4 5 6 7 7Potrebbe essere una disposizione …




Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.