Hot answers tagged

8 votes

German pharmacy payment

Jelly, 14 bytes ÷⁵«⁵»5«+ȷ-4ær2 A monadic Link that accepts the full price as a float and outputs the charge as a float. Try it online! How? ...
Jonathan Allan's user avatar
6 votes

German pharmacy payment

APL+WIN, 21 bytes Prompts for input 2⍕(n⌊((.1×n←⎕)⌈5))⌊10 Try it online! Thanks to Dyalog Classic
Graham's user avatar
  • 5,436
6 votes

How Many Paint Tins Do I Need?

Uiua,  4  3 bytes ⌈×÷ Try it! -1 thanks to alephalpha Takes input in the order coverage length height ...
chunes's user avatar
  • 22.7k
6 votes

How Many Paint Tins Do I Need?

Jelly, 3 bytes P÷Ċ A monadic Link that accepts the dimensions on the left and the paint tin coverage on the right and yields the number of tins required. Try it ...
Jonathan Allan's user avatar
5 votes

German pharmacy payment

R, 39 bytes \(x)round(.001+min(x,max(.1*x,5),10),2) Basically using the formula given by the OP. -5 bytes thanks to @doubleunary -3 bytes and fix a rounding error ...
Evargalo's user avatar
  • 241
5 votes

How Many Paint Tins Do I Need?

Vyxal 3, 3 bytes ÷×⌈ Try it Online! Similar to most other answers. Divide by coverage, multiply by other dimension, take ceiling.
Nick Kennedy's user avatar
  • 18.9k
4 votes

German pharmacy payment

APL (Dyalog Unicode), 13 bytes 2⍕⊢⌊10⌊5⌈.1×⊢ Try it online! Tacit prefix function. Takes input as number. Thanks to Graham for original APL solution. How it works:...
Tbw's user avatar
  • 211
4 votes

How Many Paint Tins Do I Need?

APL (Dyalog Classic), 3 bytes ⌈÷/ Try it online! Written as a tacit function that takes a vector with entries length, coverage, and height, in that order. ...
Tbw's user avatar
  • 211
3 votes

Print 0 to 100 without 1-9 characters

makina, 58 bytes v<<<<<<LtIaaa; >Pu>>>?= LCS UC>n0;H>>^>>n0; UPJ >JC>U I AM BUTTER FEED ME BOT I'm a bot. ...
Bridget's user avatar
  • 31
3 votes

German pharmacy payment

JavaScript (Node.js), 40 bytes x=>Math.min(x,x<50?5:(x*10+.5|0)/100,10) Try it online! Python 3, 45 bytes ...
l4m2's user avatar
  • 20.4k
3 votes

How Many Paint Tins Do I Need?

JavaScript (Node.js), 22 bytes (a,b,c)=>(a*b+c-1)/c|0 Try it online! JavaScript (Node.js), 20 bytes suggested by Arnauld ...
l4m2's user avatar
  • 20.4k
3 votes

How Many Paint Tins Do I Need?

APL+WIN, 6 bytes Prompts for three numbers. Coverage followed by wall dimensions: ⌈⎕×⎕÷⎕ Try it online! Thanks to Dyalog Classic
Graham's user avatar
  • 5,436
3 votes

How Many Paint Tins Do I Need?

Python 3.8 (pre-release), 25 23 bytes lambda l,h,c:-(-l*h//c) Try it online! Edit -2 bytes thanks to Neil
SevC_10's user avatar
  • 387
3 votes

How Many Paint Tins Do I Need?

Arturo, 15 bytes $=>[ceil//&*&&] Try it! ...
chunes's user avatar
  • 22.7k
3 votes

How Many Paint Tins Do I Need?

Scala 3, 20 bytes (l,h,c)=>(l*h+c-1)/c Attempt This Online!
138 Aspen's user avatar
  • 4,755
3 votes

How Many Paint Tins Do I Need?

Charcoal, 8 bytes I±÷×NN±N Try it online! Link is to verbose version of code. Explanation: Port of @SevC_10's Python answer. ...
Neil's user avatar
  • 166k
3 votes

How Many Paint Tins Do I Need?

Retina 0.8.2, 39 bytes .+ $* 1(?=1*¶(1+)¶) $1 (1+)(?=1*¶1+¶\1) Try it online! Takes input on separate lines but link is to test suite that splits on commas for ...
Neil's user avatar
  • 166k
3 votes

How Many Paint Tins Do I Need?

Japt, 5 bytes ×/V c Try it here
Shaggy's user avatar
  • 41.6k
3 votes

How Many Paint Tins Do I Need?

sclin, 6 bytes / * |^ Try it on scline! Takes input as H L C.
Mama Fun Roll's user avatar
2 votes

Increment an Array

R, 45 bytes \(x)`if`(sd(c(x,x)),x+!rank(x,,"f")-1,c(x,1)) Attempt This Online! This would be 4 bytes longer as a full program, which is a fairer ...
Kirill L.'s user avatar
  • 13.7k
2 votes

Is this relationship creepy?

Uiua, 8 bytes <+7÷2⊃↥↧ Try it online! ...
Bubbler's user avatar
  • 73.8k
2 votes

How long is my number: Restricted Version

TI-Basic, 9 8 bytes int(log(1+10abs(Ans Takes input in Ans. -1 byte thanks to MarcMush.
Yousername's user avatar
  • 3,650
2 votes

Landmine Number I

Uiua, 21 bytes /+♭×1_2=⊟⊃/+/×↘1↻1⍉◫3 Try it! ...
chunes's user avatar
  • 22.7k
2 votes

German pharmacy payment

Retina 0.8.2, 95 92 bytes \. .+ $* ^(.{1000}(?=.{8995})|.(.{499,998})(?=\2{9}....)|.{0,500}).* 00$.1 0*(.+)(..) $1.$2 Try it online! Link includes test cases. ...
Neil's user avatar
  • 166k
2 votes

No strings (or numbers) attached

Vyxal, 22 bytes › ⇧ ›⇧ ⇧⇧ ₀½ ⇧T ₀⇩‹ ₀⇩ ₀‹ ₀ ₄E∑⇧ Try it Online! I think all of these are optimal aside from maybe 7 and 42, but I couldn't find anything shorter. ...
emanresu A's user avatar
  • 35.6k
2 votes

No strings (or numbers) attached

Uiua, 37 36 bytes ⌊⚂ ⌊η ⌈η ⌊π ⌈π ⌈+πη ⌊τ ⌈τ ⌈+τη ⌊×ππ ⌈×ππ ⌊+τⁿππ Try it! I will be curious to see if anyone has any two-byters for 0. I found a dozen three-byters....
chunes's user avatar
  • 22.7k
2 votes

German pharmacy payment

Google Sheets / Microsoft Excel, 31 bytes =fixed(min(10,A1,max(5,A1/10))) Put the input in cell A1 and the formula in ...
doubleunary's user avatar
2 votes

German pharmacy payment

Ruby, 42 36 bytes ->a{[a,[a/10,5].max,10].min.round 2} Try it online! Ruby, 38 bytes Formatted as per initial requirement: ...
G B's user avatar
  • 21.3k
2 votes

How Many Paint Tins Do I Need?

Vyxal r, 3 bytes */⌈ Try it Online! Hehehehe flag go brrrr
lyxal's user avatar
  • 32.5k
2 votes

How Many Paint Tins Do I Need?

PowerShell, 40 bytes param($l,$h,$c)[math]::Ceiling($l*$h/$c) Try it online! Thanks Julian! PowerShell, 47 bytes ...
I.T Delinquent's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible