Slide 1

Slide 1 text

Rustॳ৺ऀ͸ ·ͣڝϓϩ͔Β࢝ΊͨΒ ྑͦ͞͏ͬͯ࿩

Slide 2

Slide 2 text

ࣗݾ঺հ • Kohno Fumiya ( @fnwiya ) • Japan Venture Research Co., LTD. • React Native & Ruby on Rails • RustΛۀ຿ʹಋೖ͍ͨ͠ʢ͢Δʣ

Slide 3

Slide 3 text

৽͍͠ݴޠͷशಘʹ͸ ࣗ෼ͷ࡞Γ͍ͨ΋ͷΛ࡞ΔաఔͰ ֶͿͷ͕ϕετ

Slide 4

Slide 4 text

ڝϓϩͱ͸ ڝٕϓϩάϥϛϯάʢӳޠ: Competitive programmingɺུশ: ڝϓϩʣͱ͸ɺ ϓϩάϥϛϯάίϯςετͰߦΘΕΔڝٕͷҰछͰ͋Δɻ ڝٕϓϩάϥϛϯάͰ͸ɺࢀՃऀશһʹಉҰͷ՝୊͕ग़୊͞ΕɺΑΓૣ͘༩͑ ΒΕͨཁٻΛຬ଍͢ΔϓϩάϥϜΛਖ਼֬ʹهड़͢Δ͜ͱΛڝ͏ɻίϯϐϡʔλ αΠΤϯε΍਺ֶͷ஌ࣝΛඞཁͱ͢Δ໰୊͕ଟ͘ɺ৽ଔֶੜͷ࠾༻׆ಈͳͲʹ ࢖ΘΕΔ͜ͱ΋͋Δɻଟ͘ͷίϯςετͰΦϯϥΠϯδϟοδ͕࠾༻͞Ε͍ͯ Δɻ ·ͨɺڝٕϓϩάϥϛϯάʹࢀՃ͢ΔਓΛʮڝٕϓϩάϥϚʯ·ͨ͸ʮڝϓϩ erʯͱݺͿ͜ͱ͕͋Δɻ https://ja.wikipedia.org/wiki/ڝٕϓϩάϥϛϯά

Slide 5

Slide 5 text

ྫʣࣗવ਺ a , b͕༩͑ΒΕ·͢ɻ a ͱ b ͷ࿨͕ૉ਺ͳΒYes, ૉ਺Ҏ ֎ͳΒNoΛग़ྗ͍ͯͩ͘͠͞ɻ (a, b < 1000)

Slide 6

Slide 6 text

Rustacean͕ڝϓϩΛ͢΂͖ཧ༝ • ࡞Γ͍ͨ΋ͷ͕ͳͯ͘΋໰୊͕͋Δ • ؀ڥߏஙෆཁ • Rustಛ༗ͳ͜ͱ͸Ұ௨Γ৮ΕΒΕΔ • String vs VecͳͲจࣈྻͷѻ͍ • ύλʔϯϚονɺmap().collect()ɺॴ༗ݖ • ࣮ߦ଎౓ ≒ C++

Slide 7

Slide 7 text

RustͰڝϓϩ͢Δͱ͖ͷ஫ҙ఺ • ඪ४ೖྗ use std::io::*; use std::str::FromStr; fn read() -> T { let stdin = stdin(); let stdin = stdin.lock(); let token: String = stdin .bytes() .map(|c| c.expect("failed to read char") as char) .skip_while(|c| c.is_whitespace()) .take_while(|c| !c.is_whitespace()) .collect(); token.parse().ok().expect("failed to parse token") } https://qiita.com/tubo28/items/ e6076e9040da57368845#%E5%85%A5%E5%87%BA%E5%8A%9B

Slide 8

Slide 8 text

ڝϓϩͰ͸਎ʹ͔ͭͳ͍͜ͱ • ςετ • Ϟδϡʔϧ • νʔϜ։ൃ

Slide 9

Slide 9 text

Rust͕࢖͑ΔڝϓϩαΠτ • AtCoder • HackerRank • AOJ • ☓ topsider ·ͣ AtCoder ʹొ࿥ͨ͠Β࣍ʹ΍Δ͜ͱ ʙ ͜Ε͚ͩղ͚͹े෼ಆ͑Δʂաڈ໰ਫ਼બ 10 ໰ ʙ( https://qiita.com/drken/items/fd4e5e3630d0f5859067#5- %E9%81%8E%E5%8E%BB%E5%95%8F%E7%B2%BE%E9%81%B8-10- %E5%95%8F ) ͕͓͢͢Ί

Slide 10

Slide 10 text

No content