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
45
競技プログラミングで見る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
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
GitHub's CSS Performance
jonrohan
1030
460k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
How GitHub (no longer) Works
holman
310
140k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
800
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