Öû»ÏµÊý
ʲôÊÇÖû»ÏµÊýÖû»ÊÇÖ¸½«¸ø¶¨¼¯ºÏµÄËùÓгÉÔ±ÅÅÁгÉÒ»¸öÐòÁеĹý³Ì¡£Ò»×én¸öÔªËØÉϵÄÖû»ÊýÓÉn¸ø³ö£¡£¬ÆäÖС°£ °´ú±í½×³ËÓÃP£¨n£¬k£©±íʾµÄÖû»ÏµÊý±íʾ´ÓÒ»×én
½â´ð¶¯Ì¬
APL£¨DyalogÀ©Õ¹£©£¬5×Ö½Ú ?¡Â?£¡-?×ó²ÎÊý¡Â?£¡³ýÒԽ׳ˣ¬½«½×³ËÓ¦ÓÃÓÚÁ½¸ö²ÎÊý£¬È»ºó½øÐгý·¨-¼õ·¨-ÔÚÏß³¢ÊÔ£¡
Python 3.8£¨Ô¤·¢Ðа棩£¬51 23 21 bytes µ¼ÈëÊýѧ.perm TryËüÔÚÏߣ¡
±àºÅÄÚÖãº
3.8£¨Ô¤·¢²¼£©£¬31 bytes f=lambda n£¬k:k<£»1»òn*f£¨n-1£¬k-1£© Áª»úÊÔÓã¡
JavaScript ES6£¬25×Ö½Ú c=£¨n£¬k£©=>£»k£¿n*c£¨n-1£¬k-1£©£º1
c£¨gcc£©£¬34 32 27 bytes ½ÚÊ¡ÁË2×Ö½Ú£¬ÕâÒª¸ÐлDavide£¬ËûÏàÐÅIrratixµÄJavaScript´ð°¸£¡£¡£¡
f£¨n£¬k£©{n=k£¿n*f£¨n-1£¬k-1£©£º1£»} ÔÚÏßÊÔÓã¡
¶úÓïv2£¬34×Ö½Ú gt£»ÊäÈëgt£»Êä³ö3 ÔÚÏßÊÔÓã¡
win
05AB1EµÄÄÚÖã¬1 byte ebuiltins ftw¡®\£¨¥Ä£©¡¯/¡¯
µÚÒ»¸öÊäÈëÊÇ\$k\$£¬µÚ¶þ¸öÊäÈëÊÇ\$n\$¡£eÊÇÅÅÁÐÊýµÄÄÚÖã¬Òò´Ë\$P£¨n£¬k£©=\frac{n£¡}{£¨n-k£©£¡}\$.
Áª»úÊÔÓûòÑéÖ¤ËùÓвâÊÔÓÃÀý¡£
MathGolf£¬5 bytes ?!-!/ °´\$k\text{}n\$˳ÐòÊäÈë¡£
Áª»úÊÔÓá£
ExÒÄƽÃ棺
? #·Ö±ðÔÚ¶ÑÕ»ÉÏÓ¦ÓÃÒÔÏÂÁ½¸öÃüÁ£¡#È¡µÚ¶þ¸ö£¨Òþʽ£©ÊäÈëÕûÊýµÄ½×³Ë-#´ÓµÚÒ»¸ö£¨Òþʽ£©ÊäÈëÕûÊýÖмõÈ¥µÚ¶þ¸ö£¡#È¡£¨n-k£©µÄ½×³Ë/#ÕûÊý³ýn£¡°´£¨n-k£©£¡#£¨ÔÚ´ËÖ®ºó£¬Õû¸ö¶ÑÕ»½«×÷Ϊ½á¹ûÒþʽÊä³ö£©PowerShell£¬28 bytes param£¨$a£¬$b£©'$a--*'*$b+1
iex Try online£¡
PowerShell 7£¬43×Ö½Ú $f={param£¨$a£¬$b£©$b£¿$a*£¨&£»$f£¨$a-1£©£¨$b-1£©£©£º1} ûÓÐTIOÁ´½Ó£¬ÒòΪTIOÈÔÈ»ÔÚ²»Ö§³ÖÈýÔªÔËËã·ûµÄPS 6ÉÏÔËÐС£
Pyth£¬4 .P.* ÇëÁª»úÊÔÓã¡
Explanation Q 2Ôª×éµÄÒþʽÊäÈë¡£*splat.P nPrÏÔʽÊä³öÍâ¿Ç£¬4×Ö½Ú ¡Ç¡ü?? ÔÚÏßÊÔÓã¡
¡Ç#µÄ¡ü#µÚÒ»¸ökÔªËØ£¨kÊǵڶþ¸ö²ÎÊý£©µÄ³Ë»ý? #?#1¡nµÄ·´Ã棨nÊǵÚÒ»¸ö²ÎÊý£©Retina£¬37 bytes \d+*~[quot£»
"£»L$v`£¨
*£©\u1$¡£$* ÇëÔÚÏßÊÔÓã¡Á´½Ó°üÀ¨²âÊÔÓÃÀý¡£ÒÔk n.ExµÄ˳Ðò½øÐÐÊäÈëÒÄƽÃ棺
\d+* ½«ÊäÈëת»»ÎªÒ»Ôª¡£
L$v`£¨*£©\u1$.$* Áгö´Ón-k+1µ½nµÄÊý×Ö£¬Ã¿¸öÊý×ÖºóÃ涼ÓÐÒ»¸ö*ºó׺¡£
quot£» ²»ÒªÓÃĬÈÏ»»Ðзû·Ö¸ô½á¹û¡£
[quot£» Óøø¶¨µÄ×Ö·û´®×÷Ϊ½á¹ûµÄǰ׺¡£
~ ½«Æä×÷ΪRetina 1±í´ïʽ½øÐмÆËã¡£
ʾÀý£º¶ÔÓÚÊäÈë2 100£¬ÓÐÁ½¸öÆ¥ÅäÏÆäÖÐ$.'È¡Öµ99ºÍ100¡£Òò´Ë£¬LÃüÁîµÄ½á¹ûÊÇ
.+$¡££¨99*100* µ±×÷ΪRetina³ÌÐòÖ´ÐÐʱ£¬Õ⽫ÓÃËùÐèµÄ½á¹ûÌæ»»ÊäÈë¡£
carcover£¬7 bytes i¡Çn¡n try it online£¡Á´½Óµ½Ïêϸ°æ±¾µÄ´úÂ롣ǰÈÎÒÄƽÃ棺
n Input'k'¡?Range from'0'to'k-1'n Input'n'?Subtract¼´Range from'n-k+1'to'n'£¨inclusive£©¦Ðproducti Cast to stringÒþʽ´òÓ¡Julia£¬20 bytes ÕâÀïûʲôÌرðµÄ£¬Ö»ÒªÓ¦Óûù±¾¶¨Òå
p£¨n£¬k£©=prod£¨n-k+1:n£© ¾Í¿ÉÒÔÔÚÏßÊÔÓã¡
WolframÓïÑÔ£¨Mathematica£©£¬11×Ö½Ú #£¡/(#-#2)!&£» Áª»úÊÔÓã¡2
Japt£¬6 bytes o¨¢V l ÔÚÕâÀïÊÔÒ»ÊÔ2
Jelly£¬4 bytes ?ÔÚÏßÊÔÒ»ÊÔ£¡
?¶ÔÓÚ1¡£¡£k¡¢ ´Ón'ÖмõÈ¥Ëü²¢µÝÔö¡£PÄòúÆ·¡£ »òÕߣ¬
¹û¶³£¬4 bytes c¡Á£¡}ÔÚÏßÊÔÊÔ°É£¡
c nCk¡Á´Î£¡}k£¡ ¶îÍâ½â¾ö·½°¸£¬5×Ö½Ú£¬È«²¿ASCII:£¬\ux£¡£º/
Òò×Ó£¬27×Ö½Ú Ê¹ÓãºÊýѧ×éºÏnpk tryËüÔÚÏߣ¡
ÓÐÒ»¸öÄÚÖõġ£¡£¡£Ö»Êǽø¿ÚµÄʱ¼äÌ«³¤ÁË¡£¸üÁîÈËÞÏÞεÄÊÇ£¬ÎÒÕÒ²»µ½Ò»¸ö·ÇÄÚÖõĽâ¾ö·½°¸£º
Factor£¬28 bytes [[1£¬b]swap tail*product] ÔÚÏßÊÔÓã¡
´Ó¶ÑÕ»ÖлñÈ¡Á½¸öÊý×Ökn£¬´Ó°üº¬·¶Î§1..nÖÐÌáÈ¡×îºóµÄk¸öÊý×Ö£¬²¢¼ÆËã³Ë»ý¡£¿ÕÐòÁеij˻ýÊÇ1.- End
ÃâÔðÉùÃ÷£º
±¾Ò³ÄÚÈݽö´ú±í×÷Õß±¾ÈËÒâ¼û£¬ÈôÒò´Ë²úÉúÈκξÀ·×ÓÉ×÷Õß±¾È˸ºÔ𣬸ÅÓëÇÙµºÍø¹«Ë¾Î޹ء£±¾Ò³ÄÚÈݽö¹©²Î¿¼£¬ÇëÄú¸ù¾Ý×ÔÉíʵ¼ÊÇé¿ö½÷É÷²Ù×÷¡£ÓÈÆäÉæ¼°Äú»òµÚÈý·½ÀûÒæµÈÊÂÏÇë×ÉѯרҵÈËÊ¿´¦Àí¡£