¥Ù¥ë¥¯¡¦¥«¥Ã¥Ä¥§ |
¥È¥â¥¨¤µ¤ó¤¬Ã¼
2¡ß2¡ß2¡ß2¡á16 ¥È¥â¥¨¤µ¤ó¤¬Ã¼¤«¤é°ì¤ÄÆ⦠2¡ß2¡ß2¡á8 ¥È¥â¥¨¤µ¤ó¤¬¿¿¤óÃæ 2¡ß2¡á4 ¹ç·×28Ä̤ê¤Ë¤Ê¤ê¤Þ¤·¤¿¡£ ¤½¤ì¤Ë¤·¤Æ¤â»Ò¶¡¤¿¤Á¡¢Ãç°¤¹¤®¤Þ¤¹¤Í¡£ |
¡¡¡¡
6·î29Æü¡ÊÌÚ¡Ë 0:08:10¡¡¡¡
¡¡¡¡52560 |
»ç¤Îé¬é¯¤Î¿Í |
Åоì¿Íʪ¤ò¡¢A,B,C,D,E¤ËÊѹ¹¤·¤Þ¤¹¡£
A¤ÎÎÙ¤ÏD¤«E¡¢ D¤ÈE¤ÏÎ٤ϥÀ¥á DAE¤ÈB,C¤Î½çÎó¤¬3!¡á6Ä̤ê EAD¤ÈB,C¤Î½çÎó¤¬3!¡á6Ä̤ê A¤¬º¸Ã¼¤ËÃå¤Æ¡¢ÎÙ¤¬D¤Î¾ì¹ç¤¬£´Ä̤ê A¤¬º¸Ã¼¤ËÃå¤Æ¡¢ÎÙ¤¬E¤Î¾ì¹ç¤¬£´Ä̤ê A¤¬±¦Ã¼¤ËÃå¤Æ¡¢ÎÙ¤¬D¤Î¾ì¹ç¤¬£´Ä̤ê A¤¬±¦Ã¼¤ËÃå¤Æ¡¢ÎÙ¤¬E¤Î¾ì¹ç¤¬£´ÄÌ¤ê ¹ç·×¤·¤Æ28Ä̤ê |
¡¡¡¡
6·î29Æü¡ÊÌÚ¡Ë 0:09:59¡¡¡¡
¡¡¡¡52561 |
Mr.¥À¥ó¥Ç¥£ |
¥Ù¥ë¥¯¡¦¥«¥Ã¥Ä¥¨ÍͤΡ¡#52560¤ÈƱÍͤˤ·¤Þ¤·¤¿¡£ |
°ñÌÚ»Ô¡¡¡¡
6·î29Æü¡ÊÌÚ¡Ë 0:19:21¡¡¡¡
¡¡¡¡52562 |
º£Ç¯¤«¤é¹âÎð¼Ô |
¥Ù¥ë¥¯¡¦¥«¥Ã¥Ä¥¨¤µ¤ó#52560¤ÈÎà»÷¤Ç¤·¤¿
¥È¥â¥¨¤µ¤ó¤¬Ã¼¤Î¾ì¹ç¤Ë2¡ß2¡ß2¡ß1¤ò6¤È¤·¤Æ24¤òÁ÷¤Ã¤Æ¤¤¤Þ¤·¤¿¡£ ¤³¤Î´Ö°ã¤¤¤Ëµ¤¤Å¤¯¤Þ¤Ç¤Ë»þ´Ö¤òϲÈñ¤·¤Þ¤·¤¿ |
¡¡¡¡
6·î29Æü¡ÊÌÚ¡Ë 0:31:16¡¡¡¡
¡¡¡¡52563 |
¤ß¤«¤ó |
£Á¡¦£Â¡¦£Ã¡¦£Ä¡¦£Å¤Î£µ¿Í¤Ç¹Í¤¨¤ë¡£
¡Ê£±¡Ë£Á¤¬£Â¤È£Ã¤Î´Ö¤Ë¤Ê¤¤¾ì¹ç £Á¡¦£Â¡¦£Ã¡¡¤¬¤³¤Î½ç¤Çʤ־ì¹ç £Á¤È£Â¤Î´Ö¤Ë£Ä¤«£Å¤òÆþ¤ì¡¢»Ä¤ê¤Î£±¿Í¤Ï£Á¤Îº¸¡¢£Â¤È£Ã¤Î´Ö¡¢£Ã¤Î±¦¤Î¤¤¤º¤ì¤«¤ËÆþ¤ì¤ë¡£ ¤·¤¿¤¬¤Ã¤Æ¡¢£²¡ß£³¡á£¶Ä̤ꡣ £Á¡¦£Ã¡¦£Â¡¢£Â¡¦£Ã¡¦£Á¡¢£Â¡¦£Á¡¦£Ã¤Î¾ì¹ç¤âƱÍͤʤΤǡ¢£¶¡ß£´¡á£²£´Ä̤ꡣ ¡Ê£²¡Ë£Á¤¬£Â¤È£Ã¤Î´Ö¤Ë¤¢¤ë¾ì¹ç £Â¡¦£Á¡¦£Ã¡¡¤¬¤³¤Î½ç¤Çʤ־ì¹ç £Â¤È£Á¤Î´Ö¤Ë£Ä¤«£Å¤òÆþ¤ì¡¢»Ä¤ê¤Î£±¿Í¤ò£Á¤È£Ã¤Î´Ö¤ËÆþ¤ì¤ë¡£ ¤·¤¿¤¬¤Ã¤Æ£²¡ß£±¡á£²Ä̤ꡣ £Ã¡¦£Á¡¦£Â¤Î¾ì¹ç¤âƱÍͤʤΤǡ¢£²¡ß£²¡á£´Ä̤ꡣ µá¤á¤ë¤Î¤Ï¡Ê£±¡Ë¤È¡Ê£²¡Ë¤ÎϤʤΤǡ¢£²£´¡Ü£´¡á£²£¸Ä̤ꡣ Á´ÂΤ«¤é¥À¥á¤ÊÎã¤ò°ú¤¤¤Æ¤¤¤¯¤Î¤¬¥é¥¯¤«¤È»×¤¤¤¤ä¡¢°Õ³°¤È¤¦¤Þ¤¯¤¤¤«¤º¤Ë¶ìÀ路¤Þ¤·¤¿¡£ ²òË¡¤ò¸«¤Æ¤·¤Þ¤¨¤ÐÂ礷¤¿ÌäÂê¤Ë¤Ï»×¤¨¤Ê¤¤¤ó¤À¤±¤É¡¢°ìȯ¤Ç¹ç¤ï¤»¤ë¤Î¤Ï¤Ê¤«¤Ê¤«¶ÛÄ¥¤·¤Þ¤¹¡£ |
¡¡¡¡
6·î29Æü¡ÊÌÚ¡Ë 0:46:14¡¡¡¡
¡¡¡¡52564 |
¡Ö¿ô³Ø¡×¾®Î¹¹Ô |
¤Þ¤º¤ÏÃˤλҤò3¿Íʤ٤Ƥª¤¤¤Æ¡¢½÷¤Î»Ò¤ò´Ö¤ËÆþ¤ì¤Æ¹Ô¤¤Þ¤·¤¿¡£
|
¡¡¡¡
6·î29Æü¡ÊÌÚ¡Ë 2:28:12¡¡¡¡
¡¡¡¡52565 |
¼êÉÁ¤¿ÞÌÌ¿¦¿Í |
ChatGPT¤ÇÌäÂê¤ò²ò¤¤¤ÆÌ㤤¤Þ¤·¤¿¡£ |
¡¡¡¡
6·î29Æü¡ÊÌÚ¡Ë 5:49:32¡¡¡¡
¡¡¡¡52566 |
¡Ö¿ô³Ø¡×¾®Î¹¹Ô |
#52565
¡Ö¥Þ¥µ¥ë¤µ¤ó¡×¤Ï¿å¿§¤À¤Ã¤¿¤Î¤ÇÃˤλҤȤ·¤Þ¤·¤¿¤¬¡¢°ã¤Ã¤Æ¤¤¤¿¤é¤´¤á¤ó¤Ê¤µ¤¤¡£ |
¡¡¡¡
6·î29Æü¡ÊÌÚ¡Ë 7:24:36¡¡¡¡
¡¡¡¡52567 |
¥Ù¥ë¥¯¡¦¥«¥Ã¥Ä¥§ |
#52567
»ä¤â¡Ö»Ò¶¡¤¿¤Á¡×¤È½ñ¤¤Þ¤·¤¿¤¬¡¢¤É¤³¤Ë¤â»Ò¶¡¤È¤Ï½ñ¤¤¤Æ¤¢¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£ |
¡¡¡¡
6·î29Æü¡ÊÌÚ¡Ë 9:27:45¡¡¡¡
¡¡¡¡52568 |
¼êÉÁ¤¿ÞÌÌ¿¦¿Í |
import itertools
def count_arrangements(): people = ['¥È¥â¥¨', '¥Þ¥µ¥ë', '¥Þ¥µ¥Ò¥³', '¥Þ¥ê¥³', '¥Ä¥è¥·'] arrangements = list(itertools.permutations(people)) count = 0 for arrangement in arrangements: if is_valid(arrangement): count += 1 return count def is_valid(arrangement): for i in range(len(arrangement)): if arrangement[i] == '¥È¥â¥¨': if i > 0 and (arrangement[i-1] == '¥Þ¥µ¥ë' or arrangement[i-1] == '¥Þ¥µ¥Ò¥³'): return False if i < len(arrangement)-1 and (arrangement[i+1] == '¥Þ¥µ¥ë' or arrangement[i+1] == '¥Þ¥µ¥Ò¥³'): return False elif arrangement[i] == '¥Þ¥ê¥³': if i > 0 and arrangement[i-1] == '¥Ä¥è¥·': return False if i < len(arrangement)-1 and arrangement[i+1] == '¥Ä¥è¥·': return False return True count = count_arrangements() print(f"ʤÓÊý¤ÎÁí¿ô: {count}") ChatGPT¤Ë¥Ñ¥¤¥½¥ó¥×¥í¥°¥é¥à¤òºîÀ®¤·¤Æ¤â¤é¤¤¤Þ¤·¤¿¡£¤³¤ó¤Ê´ñÎï¤Ê¡¢¥×¥í¥°¥é¥à¤Ï¡¢»ä¤Ë¤ÏÁȤá¤Þ¤»¤ó¡£ |
¡¡¡¡
6·î29Æü¡ÊÌÚ¡Ë 10:49:29¡¡¡¡
¡¡¡¡52569 |
¡Ö¿ô³Ø¡×¾®Î¹¹Ô |
ChatGPT¤¬»×¤¦¤è¤¦¤ËÁà¤ì¤Þ¤»¤ó¡£
º£²ó¤ÎÌäÂê¤ò¤½¤Î¤Þ¤Þ¥³¥Ô¥Ú¤ÇSend a message¤ËÆþ¤ì¤ë¤È¡¢ > ¤Þ¤º¡¢¥È¥â¥¨¤µ¤ó¤Ï¥Þ¥µ¥ë¤µ¤ó¤ÎÎÙ¤â¥Þ¥µ¥Ò¥³¤¯¤ó¤ÎÎÙ¤âµñÈݤ¹¤ë¤¿¤á¡¢Èà½÷¤ÎʤÓÊý¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£ > >¥È¥â¥¨ _ _ > >¥Þ¥µ¥ë¤µ¤ó¤È¥Þ¥µ¥Ò¥³¤¯¤ó¤ÎʤÓÊý¤Ï¡¢¥È¥â¥¨¤µ¤ó¤ÎÎ٤ˤʤ뤳¤È¤¬¤Ç¤¤Ê¤¤¤¿¤á¡¢Èà¤é¤ò¤½¤ì¤¾¤ìÊÌ¡¹¤Î¥¹¥í¥Ã¥È¤ËÇÛÃÖ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤Þ¤¿¡¢¥Þ¥µ¥ë¤µ¤ó¤È¥Þ¥µ¥Ò¥³¤¯¤ó¤Î´Ö¤Ë¤Ï¾¤Î¿Í¤¬Æþ¤ë²ÄǽÀ¤¬¤¢¤ê¤Þ¤¹¡£ > >¥È¥â¥¨ ¥Þ¥µ¥ë ¥Þ¥µ¥Ò¥³ ¤Ê¤É¤È¤Ê¤Ã¤Æ¡¢ºÇ½ª¤Ï > 5 ¡ß 4 ¡ß 3 ¡ß 2 ¡ß 1 = 120 > >¤·¤¿¤¬¤Ã¤Æ¡¢£µ¿Í¤ÎʤÓÊý¤Î¾ì¹ç¤Î¿ô¤Ï120Ä̤ê¤Ç¤¹¡£ ¤Æ¤Ê¤³¤È¤Ë¡£¤É¤ó¤Ê¤Õ¤¦¤Ë¥×¥í¥ó¥×¥È¥¨¥ó¥¸¥Ë¥¢¥ê¥ó¥°¤·¤¿¤é±þ¤¨¤Æ¤¯¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¤Î¤«¡© |
¡¡¡¡
6·î29Æü¡ÊÌÚ¡Ë 12:51:22¡¡¡¡
¡¡¡¡52570 |
¥Ù¥ë¥¯¡¦¥«¥Ã¥Ä¥§ |
µñÈݤ˴ط¸¤Ê¤¯Ê¤٤ë¤Î¤Ç¤¢¤ì¤Ð120Ä̤ê¤Ë¤Ê¤ê¤Þ¤¹¤Í¡£
¤³¤Î¾ò·ï¤Ë¹ç¤¦Ê¤ÙÊý¤Î¤ß¤ò¿ô¤¨¤ë¡¢¤È¶ñÂÎŪ¤Ëɽ¸½¤·¤Ê¤¤¤È¤À¤á¤Ê¤Î¤Ç¤·¤ç¤¦¤«¡£ ÁǿͤʤΤǡ¢¸«Åö°ã¤¤¤À¤Ã¤¿¤é¤¹¤ß¤Þ¤»¤ó¡£ |
¡¡¡¡
6·î29Æü¡ÊÌÚ¡Ë 13:30:10¡¡¡¡
¡¡¡¡52571 |
¼êÉÁ¤¿ÞÌÌ¿¦¿Í |
ChatGPT¤Î¼ÁÌäÍó¤ËÌäÂê¤ò¥³¥Ô¡¼¥¢¥ó¥É¥Ú¡¼¥¹¥È¤·¤Æshift+enter¤Çpython code¤òºîÀ®¤·¤Æ²¼¤µ¤¤¡£¤ÈÄɲ䷤ơ¢Á÷¿®¤¹¤ë¤È¡¢python code¤òºîÀ®¤·¤Æ¤¯¤ì¤Þ¤¹¡£ |
¡¡¡¡
6·î29Æü¡ÊÌÚ¡Ë 14:57:46¡¡¡¡
¡¡¡¡52572 |
¥Ù¥ë¥¯¡¦¥«¥Ã¥Ä¥§ |
¤½¤ó¤Ê´Êñ¤Ë¡¦¡¦¡¦»þÂå¤Ë¤Ä¤¤¤Æ¤¤¤±¤Ê¤¤¡£ |
¡¡¡¡
6·î29Æü¡ÊÌÚ¡Ë 15:19:47¡¡¡¡
¡¡¡¡52573 |
¼êÉÁ¤¿ÞÌÌ¿¦¿Í |
atcoder problems¤ÎÌäÂê¤òchatGPT¤Ëpython code¤òºîÀ®¤·¤ÆÌã¤Ã¤Æ¤¤¤Þ¤¹¡£ |
¡¡¡¡
6·î29Æü¡ÊÌÚ¡Ë 16:09:19¡¡¡¡
¡¡¡¡52574 |
¡Ö¿ô³Ø¡×¾®Î¹¹Ô |
»ä¤â¤ä¤Ã¤Æ¤ß¤Þ¤·¤¿¡£°Ê²¼¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥à¤òºî¤Ã¤Æ¤¤¤¿¤À¤¤Þ¤·¤¿¡£
¤¹¤´¤¤¤Ç¤¹¤Í¤§¡£ from itertools import permutations people = ['¥È¥â¥¨', '¥Þ¥µ¥ë', '¥Þ¥µ¥Ò¥³', '¥Þ¥ê¥³', '¥Ä¥è¥·'] forbidden_pairs = [('¥È¥â¥¨', '¥Þ¥µ¥ë'), ('¥È¥â¥¨', '¥Þ¥µ¥Ò¥³'), ('¥Þ¥ê¥³', '¥Ä¥è¥·')] count = 0 for perm in permutations(people): valid = True for pair in forbidden_pairs: if pair[0] in perm and pair[1] in perm: idx1 = perm.index(pair[0]) idx2 = perm.index(pair[1]) if abs(idx1 - idx2) == 1: valid = False break if valid: count += 1 print("¾ò·ï¤òËþ¤¿¤¹£µ¿Í¤ÎʤÓÊý¤Î¾ì¹ç¤Î¿ô:", count) |
¡¡¡¡
6·î29Æü¡ÊÌÚ¡Ë 17:29:59¡¡¡¡
¡¡¡¡52575 |
¥´¥ó¤È¤â |
½½¿ÊBasic ¤Ç
¥È¥â¥¨¡¡¡¡1 ¥Þ¥µ¥ë 2 ¥Þ¥µ¥Ò¥³ 3 ¥Þ¥ê¥³ 4 ¥Ä¥è¥· 5 ¾ì½ê¤òabcde¤È¤·¤Æ FOR a=1 to 5 FOR b=1 to 5 if b=a then goto 40 if a=1 and (b=2 or b=3) then goto 40 if b=1 and (a=2 or a=3) then goto 40 if a=4 and b=5 then goto 40 if b=4 and a=5 then goto 40 FOR c=1 to 5 if c=a or c=b then goto 30 if b=1 and (c=2 or c=3) then goto 30 if c=1 and (b=2 or b=3) then goto 30 if b=4 and c=5 then goto 30 if c=4 and b=5 then goto 30 FOR d=1 to 5 if d=a or d=b or d=c then goto 20 if c=1 and (d=2 or d=3) then goto 20 if d=1 and (c=2 or c=3) then goto 20 if c=4 and d=5 then goto 20 if d=4 and c=5 then goto 20 FOR e=1 to 5 if e=a or e=b or e=c or e=d then goto 10 if d=1 and (e=2 or e=3) then goto 10 if e=1 and (d=2 or d=3) then goto 10 if d=4 and e=5 then goto 10 if e=4 and d=5 then goto 10 let s=s+1 10 next e 20 next d 30 next c 40 next b 50 next a print s end f9²¡¤·¤Æ¡¡28¡¦¡¦¡¦¡¦¡¦¡¦(Åú¤¨) ¤³¤ÎÌäÂê¤Î¥×¥í¥°¥é¥à¤Ï´Êñ¤Ç5ʬ¤°¤é¤¤¤Ç¡¦¡¦¡¦ |
ËÀî»Ô¡¡¡¡
6·î29Æü¡ÊÌÚ¡Ë 21:00:00¡¡¡¡
MAIL:fttnm528@ybb.ne.jp ¡¡¡¡52576 |
¼êÉÁ¤¿ÞÌÌ¿¦¿Í |
¾¤Î¥×¥í¥°¥é¥à¸À¸ì¤â¿ʬ¡¢¥Í¥Ã¥È¤Ë¥Ç¡¼¥¿¤¬ºß¤ë¤Î¤Ç¡¢Âбþ²Äǽ¤À¤È»×¤¤¤Þ¤¹¡£ |
¡¡¡¡
6·î30Æü¡Ê¶â¡Ë 5:21:16¡¡¡¡
¡¡¡¡52577 |
¼êÉÁ¤¿ÞÌÌ¿¦¿Í |
from itertools import permutations
def count_arrangements(): people = ['¥È¥â¥¨', '¥Þ¥µ¥ë', '¥Þ¥µ¥Ò¥³', '¥Þ¥ê¥³', '¥Ä¥è¥·'] arrangements = list(permutations(people)) count = 0 for arrangement in arrangements: if (arrangement.index('¥Þ¥µ¥ë') == arrangement.index('¥È¥â¥¨') + 1 or arrangement.index('¥Þ¥µ¥ë') == arrangement.index('¥È¥â¥¨') - 1): continue if (arrangement.index('¥Þ¥µ¥Ò¥³') == arrangement.index('¥È¥â¥¨') + 1 or arrangement.index('¥Þ¥µ¥Ò¥³') == arrangement.index('¥È¥â¥¨') - 1): continue if arrangement.index('¥Ä¥è¥·') == arrangement.index('¥Þ¥ê¥³') + 1 or arrangement.index('¥Ä¥è¥·') == arrangement.index('¥Þ¥ê¥³') - 1: continue count += 1 return count print(count_arrangements()) ChatGPT¤ËºÆÅÙPython¥×¥í¥°¥é¥à¤òºîÀ®¤·¤ÆÌ㤤¤Þ¤·¤¿¡£¥³¥Ô¡¼¥¢¥ó¥É¥Ú¡¼¥¹¥È¤·¤¿¤Î¤Ç¤¹¤¬¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¤Í¡£ |
¡¡¡¡
6·î30Æü¡Ê¶â¡Ë 6:21:28¡¡¡¡
¡¡¡¡52578 |
¼êÉÁ¤¿ÞÌÌ¿¦¿Í |
Äó½ÐÍó¤Ç¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤Æ¤¤¤Æ¤â¡¢½ÐÎϤ¹¤ë¤È¡¢¥¤¥ó¥Ç¥ó¥È¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¤Í¡£ |
¡¡¡¡
6·î30Æü¡Ê¶â¡Ë 6:24:23¡¡¡¡
¡¡¡¡52579 |
¡Ö¿ô³Ø¡×¾®Î¹¹Ô |
#52575
¡¡from itertools import permutations ¡¡people = ['¥È¥â¥¨', '¥Þ¥µ¥ë', '¥Þ¥µ¥Ò¥³', '¥Þ¥ê¥³', '¥Ä¥è¥·'] ¡¡forbidden_pairs = [('¥È¥â¥¨', '¥Þ¥µ¥ë'), ('¥È¥â¥¨', '¥Þ¥µ¥Ò¥³'), ('¥Þ¥ê¥³', '¥Ä¥è¥·')] ¡¡count = 0 ¡¡for perm in permutations(people): ¡¡ valid = True ¡¡ for pair in forbidden_pairs: ¡¡ if pair[0] in perm and pair[1] in perm: ¡¡ idx1 = perm.index(pair[0]) ¡¡ idx2 = perm.index(pair[1]) ¡¡ if abs(idx1 - idx2) == 1: ¡¡ valid = False ¡¡ break ¡¡ if valid: ¡¡ count += 1 ¡¡print("¾ò·ï¤òËþ¤¿¤¹£µ¿Í¤ÎʤÓÊý¤Î¾ì¹ç¤Î¿ô:", count) ¥¤¥ó¥Ç¥ó¥È¤òÆþ¤ì¤Æ¤ß¤Þ¤·¤¿¡£Åú£²£¸¡¥¤Ð¤Ã¤Á¤ê¤Ç¤¹¡£ ¤Ê¤ª¡¢ËÜÌä¤ÎÀßÄê¤Ç¤Ï if pair[0] in perm and pair[1] in perm:¤Ï¤Ê¤¯¤Æ¤â¤¤¤¤¤È»×¤¤¤Þ¤¹¡£ |
¡¡¡¡
6·î30Æü¡Ê¶â¡Ë 7:00:19¡¡¡¡
¡¡¡¡52580 |
¡Ö¿ô³Ø¡×¾®Î¹¹Ô |
¥¤¥ó¥Ç¥ó¥È¤¬¾Ã¤µ¤ì¤ë¤Î¤ÇºÆÅê¹Æ¤Ç¤¹¡£
'from itertools import permutations 'people = ['¥È¥â¥¨', '¥Þ¥µ¥ë', '¥Þ¥µ¥Ò¥³', '¥Þ¥ê¥³', '¥Ä¥è¥·'] 'forbidden_pairs = [('¥È¥â¥¨', '¥Þ¥µ¥ë'), ('¥È¥â¥¨', '¥Þ¥µ¥Ò¥³'), ('¥Þ¥ê¥³', '¥Ä¥è¥·')] 'count = 0 'for perm in permutations(people): ' valid = True ' for pair in forbidden_pairs: ' idx1 = perm.index(pair[0]) ' idx2 = perm.index(pair[1]) ' if abs(idx1 - idx2) == 1: ' valid = False ' break ' if valid: ' count += 1 'print("¾ò·ï¤òËþ¤¿¤¹£µ¿Í¤ÎʤÓÊý¤Î¾ì¹ç¤Î¿ô:", count) ¹ÔƬ¤Ë¡¡'¡¡¤òÉÕ¤±¤Æ¤ß¤Þ¤·¤¿¡£ |
¡¡¡¡
6·î30Æü¡Ê¶â¡Ë 7:05:02¡¡¡¡
¡¡¡¡52581 |
¡Ö¿ô³Ø¡×¾®Î¹¹Ô |
¤¹¤ß¤Þ¤»¤ó¡£¤À¤á¤Ç¤·¤¿¡£2¸ÄϢ³¤ÎȾ³Ñ¥¹¥Ú¡¼¥¹¤¬1¸Ä¤Ë¤Ê¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¡£ |
¡¡¡¡
6·î30Æü¡Ê¶â¡Ë 7:07:03¡¡¡¡
¡¡¡¡52582 |
¡Ö¿ô³Ø¡×¾®Î¹¹Ô |
¤·¤Ä¤³¤¤¤Ç¤¹¤¬¡¢¥¤¥ó¥Ç¥ó¥È¤ÎȾ³Ñ¥¹¥Ú¡¼¥¹¤Î¿ô¤À¤±¡¢Á´³Ñ¥¹¥Ú¡¼¥¹¤òÆþ¤ì¤ÆÅê¹Æ¤Ç¤¹¡£
¥Ñ¥¤¥½¥ó¤Ïend¤¬Ìµ¤¤¤Î¤Ç¡£¡£¡£ from itertools import permutations people = ['¥È¥â¥¨', '¥Þ¥µ¥ë', '¥Þ¥µ¥Ò¥³', '¥Þ¥ê¥³', '¥Ä¥è¥·'] forbidden_pairs = [('¥È¥â¥¨', '¥Þ¥µ¥ë'), ('¥È¥â¥¨', '¥Þ¥µ¥Ò¥³'), ('¥Þ¥ê¥³', '¥Ä¥è¥·')] count = 0 for perm in permutations(people): ¡¡ valid = True ¡¡ for pair in forbidden_pairs: ¡¡¡¡ idx1 = perm.index(pair[0]) ¡¡¡¡ idx2 = perm.index(pair[1]) ¡¡¡¡ if abs(idx1 - idx2) == 1: ¡¡¡¡¡¡ valid = False ¡¡¡¡¡¡ break ¡¡ if valid: ¡¡¡¡ count += 1 print("¾ò·ï¤òËþ¤¿¤¹£µ¿Í¤ÎʤÓÊý¤Î¾ì¹ç¤Î¿ô:", count) |
¡¡¡¡
6·î30Æü¡Ê¶â¡Ë 7:16:12¡¡¡¡
¡¡¡¡52583 |
¼êÉÁ¤¿ÞÌÌ¿¦¿Í |
from itertools import permutations
def count_arrangements(): ¡¡¡¡people = ['¥È¥â¥¨', '¥Þ¥µ¥ë', '¥Þ¥µ¥Ò¥³', '¥Þ¥ê¥³', '¥Ä¥è¥·'] ¡¡¡¡arrangements = list(permutations(people)) ¡¡¡¡count = 0 ¡¡¡¡for arrangement in arrangements: ¡¡¡¡¡¡¡¡if (arrangement.index('¥Þ¥µ¥ë') == arrangement.index('¥È¥â¥¨') + 1 or ¡¡¡¡¡¡¡¡arrangement.index('¥Þ¥µ¥ë') == arrangement.index('¥È¥â¥¨') - 1): ¡¡¡¡¡¡¡¡¡¡¡¡continue ¡¡¡¡¡¡¡¡¡¡¡¡if (arrangement.index('¥Þ¥µ¥Ò¥³') == arrangement.index('¥È¥â¥¨') + 1 or ¡¡¡¡¡¡¡¡¡¡¡¡arrangement.index('¥Þ¥µ¥Ò¥³') == arrangement.index('¥È¥â¥¨') - 1): ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡continue ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡if arrangement.index('¥Ä¥è¥·') == arrangement.index('¥Þ¥ê¥³') + 1 or arrangement.index('¥Ä¥è¥·') == ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡ ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡arrangement.index('¥Þ¥ê¥³') - 1: ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡continue ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡count += 1 ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡return count ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡print(count_arrangements())¥¤¥ó¥Ç¥ó¥È¤ÎÎý½¬¤ò¤·¤Æ¤ß¤Þ¤·¤¿¡£ |
¡¡¡¡
6·î30Æü¡Ê¶â¡Ë 9:51:22¡¡¡¡
¡¡¡¡52584 |
¼êÉÁ¤¿ÞÌÌ¿¦¿Í |
ChatGPT¤ÏÆþÎϤ¹¤ë¤¿¤Ó¤Ë°ã¤¦¥×¥í¥°¥é¥à¤òºîÀ®¤·¤Æ¤¯¤ì¤Þ¤¹¡£À¨¤¤¤Ç¤¹¤Í¡£ |
¡¡¡¡
6·î30Æü¡Ê¶â¡Ë 10:54:52¡¡¡¡
¡¡¡¡52585 |
¼êÉÁ¤¿ÞÌÌ¿¦¿Í |
ChatGPT¤ÏBasic¸À¸ì¤Ç¥×¥í¥°¥é¥à¤òºîÀ®¤¹¤ë¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£ |
¡¡¡¡
6·î30Æü¡Ê¶â¡Ë 12:18:58¡¡¡¡
¡¡¡¡52586 |
¤«¤º¤0202 |
¥È¥â¥¨¤¬Ã¼¤Ë¤¤¤ë¤«Ã¼¤Ë¤¤¤Ê¤¤¤«¤Ç¹Í¤¨¤¿¤é28Ä̤ê¤Ë¤Ê¤Ã¤¿ |
¡¡¡¡
6·î30Æü¡Ê¶â¡Ë 18:57:50¡¡¡¡
¡¡¡¡52587 |
¤Þ¤ë¥±¥ó |
p "ABCDE".chars.permutation(5).map{|i|i.join}.count{|s|s !~/AB|BA|AC|CA|DE|ED/} |
¡¡¡¡
7·î1Æü¡ÊÅÚ¡Ë 16:04:19¡¡¡¡
MAIL:take4310@mobile.email.ne.jp ¡¡¡¡52588 |
¼êÉÁ¤¿ÞÌÌ¿¦¿Í |
atcoderproblems¤ÎÌäÂê¤òChatGPT¤Ë²ò¤¤¤ÆÌã¤Ã¤Æ¡¢Äó½Ð¤·¤Æ¤ß¤Þ¤·¤¿¤¬¡¢ÉÔÀµ²ò¤Î¾ì¹ç¤âͤê¤Þ¤¹¡£¥³¥ó¥Ô¥å¡¼¥¿¡¼¤¬²ò¤¤¤ÆȽÄꤷ¤Æ¤¤¤ë¤Î¤Ë²¿¸Î¤Ç¤·¤ç¤¦¡£ |
¡¡¡¡
7·î1Æü¡ÊÅÚ¡Ë 16:07:08¡¡¡¡
¡¡¡¡52589 |
¼êÉÁ¤¿ÞÌÌ¿¦¿Í |
atcderproblems¤ÎÌäÂê¤ò¡¢ChatGPT¤Ègoogle bard¤Ë²ò¤¤¤ÆÌã¤Ã¤Æ¡¢Äó½Ð¤·¤ÆÀµ²ò¿ô¤Î³ä¹ç¤òÄ´¤Ù¤Æ¸«¤è¤¦¤È»×¤Ã¤Æ¤¤¤Þ¤¹¡£ |
¡¡¡¡
7·î1Æü¡ÊÅÚ¡Ë 18:47:17¡¡¡¡
¡¡¡¡52590 |
¼êÉÁ¤¿ÞÌÌ¿¦¿Í |
atcodeproblems¤ÎABC001-A¤«¤éABC005-D¤Þ¤Ç¤Î20Ìä¤ò²ò¤¤¤¿·ë²Ì¤Ï¡¢ChatGPT¤Ï9ÌäÀµ²ò¡¢google bard¤Ï7ÌäÀµ²ò¤Ç¤·¤¿¡£ |
¡¡¡¡
7·î5Æü¡Ê¿å¡Ë 5:19:59¡¡¡¡
¡¡¡¡52591 |