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
56
競技プログラミングで見る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.5k
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Agile that works and the tools we love
rasmusluckow
328
21k
The Invisible Side of Design
smashingmag
298
50k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Navigating Team Friction
lara
183
15k
Done Done
chrislema
181
16k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
How to Ace a Technical Interview
jacobian
276
23k
The Language of Interfaces
destraynor
154
24k
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