Implementieren Sie Bucket-Sort im SAUCE-System. Die Eingabe besteht aus einem positiven int n und n double-Werten aus dem Intervall [0,1) im standard input stream, jede Zahl in einer Zeile.
Die Ausgabe der sortierten Zahlen erfolgt aufsteigend, eine Zahl pro Zeile, im standard output stream.
Comment prefix | # |
---|---|
Given input | 4 0.25 0.123456 0.01 0.87999 |
Expected output | 0.01 0.123456 0.25 0.87999 |
Comment prefix | # |
Given input | 50 0.7275636792182922 0.054665207862854004 0.6832234263420105 0.047939300537109375 0.3087193965911865 0.27707844972610474 0.7077105641365051 0.9981785416603088 0.6655489206314087 0.0913245677947998 0.9033722281455994 0.4512571692466736 0.3687828779220581 0.9981785416603088 0.38164305686950684 0.27574801445007324 0.6904257535934448 0.463653564453125 0.7620901465415955 0.7829017639160156 0.9981785416603088 0.9193277359008789 0.15195822715759277 0.4364909529685974 0.43979978561401367 0.7499061226844788 0.38656681776046753 0.7982866168022156 0.17737847566604614 0.15054744482040405 0.5943498611450195 0.3383079171180725 0.20976752042770386 0.25066131353378296 0.8259658217430115 0.3651611804962158 0.17221790552139282 0.15865451097488403 0.5874273777008057 0.2741725444793701 0.7512803673744202 0.6436221599578857 0.5710403323173523 0.08028590679168701 0.5800248384475708 0.09066444635391235 0.7525098919868469 0.7986169457435608 0.03141820430755615 0.3165324926376343 |
Expected output | 0.03141820430755615 0.047939300537109375 0.054665207862854004 0.08028590679168701 0.09066444635391235 0.0913245677947998 0.15054744482040405 0.15195822715759277 0.15865451097488403 0.17221790552139282 0.17737847566604614 0.20976752042770386 0.25066131353378296 0.2741725444793701 0.27574801445007324 0.27707844972610474 0.3087193965911865 0.3165324926376343 0.3383079171180725 0.3651611804962158 0.3687828779220581 0.38164305686950684 0.38656681776046753 0.4364909529685974 0.43979978561401367 0.4512571692466736 0.463653564453125 0.5710403323173523 0.5800248384475708 0.5874273777008057 0.5943498611450195 0.6436221599578857 0.6655489206314087 0.6832234263420105 0.6904257535934448 0.7077105641365051 0.7275636792182922 0.7499061226844788 0.7512803673744202 0.7525098919868469 0.7620901465415955 0.7829017639160156 0.7982866168022156 0.7986169457435608 0.8259658217430115 0.9033722281455994 0.9193277359008789 0.9981785416603088 0.9981785416603088 0.9981785416603088 |