Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
競技プログラミングで見るRubyの豊かさ
Search
haruguchi-yuma
August 24, 2024
1
46
競技プログラミングで見るRubyの豊かさ
haruguchi-yuma
August 24, 2024
Tweet
Share
More Decks by haruguchi-yuma
See All by haruguchi-yuma
fukuoka.rb 0x000回 LT資料
haruguchi
0
130
shikujiri-lt
haruguchi
0
1.4k
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Writing Fast Ruby
sferik
627
61k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Designing for Performance
lara
604
68k
Typedesign – Prime Four
hannesfritz
40
2.4k
Speed Design
sergeychernyshev
25
620
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Transcript
!IBSVHVDIJ ڝٕϓϩάϥϛϯάͰݟΔ 3VCZͷ๛͔͞ େࡕ3VCZձٞɹ 4BU
!IBSVHVDIJ wגࣜձࣾӬγεςϜϚωδϝϯτ wڭһˠ8FCΤϯδχΞ wڝϓϩྺ
None
ڝϓϩ "U$PEFS ͱ
ೖྗˠग़ྗ ͳΜ͔͢Δ
ͨͱ͑
ͨͱ͑
ͨͱ͑
ͨͱ͑
None
None
None
ࠓͷ ɾ"U$PEFSͷௐ·ͨ͠ ɾͦͷத͔Βհ
େࣄʹ͍ͨ͠Ձ؍ Մಡੑ ֦ுੑ อकੑ
Մಡੑ ֦ுੑ อकੑ ಡΈʹ͘͘ ෳࡶͰ͘ ʹಛԽͨ͠ ίονʂʂ େࣄʹ͍ͨ͠Ձ؍
IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@ ))ͷΛٻΊ͍ͨ
IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@ ))ͷΛٻΊ͍ͨ ೖྗྫ 42 3 ग़ྗྫ 39
IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@ ))ͷΛٻΊ͍ͨ ೖྗྫ 42 3 ग़ྗྫ 39
IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@ ))ͷΛٻΊ͍ͨ
ϙΠϯτ จࣈϦςϥϧ? joinͷΤΠϦΞε*
ϙΠϯτ จࣈϦςϥϧ? joinͷΤΠϦΞε*
ϙΠϯτ ίϚϯυͱ࣮ͯ͠ߦ evalͰअѱ͞Λԋग़
IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@ ))ͷΛٻΊ͍ͨ ࠶ܝ ͬͱ͘ॻ͚ΔΑͱ͍͏ਓ͕͍ͨΒڭ͍͑ͯͩ͘͞
ͭͷ୯ޠ͕ۭന۠ΓͰ༩͑ΒΕΔɻ ֤୯ޠͷઌ಄Λͭͳ͛ɺେจࣈͰग़ྗ͍ͨ͠
ೖྗྫ atcoder beginner contest IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@B ͭͷ୯ޠ͕ۭന۠ΓͰ༩͑ΒΕΔɻ ֤୯ޠͷઌ಄Λͭͳ͛ɺେจࣈͰग़ྗ͍ͨ͠
ೖྗྫ atcoder beginner contest IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@B ͭͷ୯ޠ͕ۭന۠ΓͰ༩͑ΒΕΔɻ ֤୯ޠͷઌ಄Λͭͳ͛ɺେจࣈͰग़ྗ͍ͨ͠
ೖྗྫ atcoder beginner contest IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@B ͭͷ୯ޠ͕ۭന۠ΓͰ༩͑ΒΕΔɻ ֤୯ޠͷઌ಄Λͭͳ͛ɺେจࣈͰग़ྗ͍ͨ͠ ग़ྗྫ
ABC
IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@B ͭͷ୯ޠ͕ۭന۠ΓͰ༩͑ΒΕΔɻ ֤୯ޠͷઌ಄Λͭͳ͛ɺେจࣈͰग़ྗ͍ͨ͠
IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@B ͭͷ୯ޠ͕ۭന۠ΓͰ༩͑ΒΕΔɻ ֤୯ޠͷઌ಄Λͭͳ͛ɺେจࣈͰग़ྗ͍ͨ͠ ͏গ͘͠Ͱ͖ͦ͏ ಡΈʹ͘͘
IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@B ͭͷ୯ޠ͕ۭന۠ΓͰ༩͑ΒΕΔɻ ֤୯ޠͷઌ಄Λͭͳ͛ɺେจࣈͰग़ྗ͍ͨ͠
ϙΠϯτ େจࣈͷมord
ϙΠϯτ େจࣈͷมord ڝϓϩͰكʹΑ͘͏ʂ
ϙΠϯτ ඪ४ग़ྗputc
" # $ͷΈ͔ΒͳΔ/จࣈͷจࣈྻ4 " # $͕ճҎ্ग़ݱ͢ΔͷԿจࣈʁ
IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@B ೖྗྫ 9 AACCCACBB " # $ͷΈ͔ΒͳΔ/จࣈͷจࣈྻ4 "
# $͕ճҎ্ग़ݱ͢ΔͷԿจࣈʁ
IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@B ೖྗྫ 9 AACCCACBB 123456789 ग़ྗྫ 8
" # $ͷΈ͔ΒͳΔ/จࣈͷจࣈྻ4 " # $͕ճҎ্ग़ݱ͢ΔͷԿจࣈʁ
IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@B " # $ͷΈ͔ΒͳΔ/จࣈͷจࣈྻ4 " # $͕ճҎ্ग़ݱ͢ΔͷԿจࣈʁ
IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@B " # $ͷΈ͔ΒͳΔ/จࣈͷจࣈྻ4 " # $͕ճҎ্ग़ݱ͢ΔͷԿจࣈʁ
IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@B " # $ͷΈ͔ΒͳΔ/จࣈͷจࣈྻ4 " # $͕ճҎ্ग़ݱ͢ΔͷԿจࣈʁ indexʹ߹ܭCZUFͬͯΔʂʂ
IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@B " # $ͷΈ͔ΒͳΔ/จࣈͷจࣈྻ4 " # $͕ճҎ্ग़ݱ͢ΔͷԿจࣈʁ
IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@B " # $ͷΈ͔ΒͳΔ/จࣈͷจࣈྻ4 " # $͕ճҎ্ग़ݱ͢ΔͷԿจࣈʁ $_ ͕3ՕॴʹݱΕΔͷ
IUUQTBUDPEFSKQDPOUFTUTBCDUBTLTBCD@B " # $ͷΈ͔ΒͳΔ/จࣈͷจࣈྻ4 " # $͕ճҎ্ग़ݱ͢ΔͷԿจࣈʁ
ϙΠϯτ Regexp#~ $_ͱͷؒͰϚονΛͱΔ
ϙΠϯτ ΠϯΫϦϝϯτ bitస ୯߲ԋࢉ -
·ͱΊ·͢
·ͱΊ ɾ͍ΖΜͳॻ͖ํ͕Ͱ͖Δ ɾϝιουͷ๛͞ ɾ߈ུຊʹࡌͬͯͳ͍ॻ͖ํΛ୳ָ͢͠͞
3VCZJTGVO ,ZPQSPJTGVOTP UBLFUIFDIBMMFOHF