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
Competitive programming by Rust
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
fnwiya
September 05, 2018
Technology
2.1k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Competitive programming by Rust
https://rust.connpass.com/event/92821/
のLT資料
fnwiya
September 05, 2018
More Decks by fnwiya
See All by fnwiya
20221102_pmconf_b1_プロダクトマネジメントと民主主義.pdf
fnwiya
3
7.7k
Serverless Rust
fnwiya
0
2.9k
WebAssembly future
fnwiya
0
2.2k
Other Decks in Technology
See All in Technology
「嘘をつくテスト」の失敗例から学ぶ 良いテストコード #frontend_phpcon_do
asumikam
0
500
EventBridge Connection
_kensh
4
590
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
50k
個人最適 から 全体最適 へ AI情報共有会・AIギルド・AI-DLC で進める カンリーの組織展開
rfdnxbro
0
1.7k
TypeScript Compiler APIとPHP-Parserを活用し、TypeScriptとPHPで型を共有する
shuta13
0
360
ABEMA の Datadog × OTel 基盤、 中から見るか? 外から見るか?
tetsuya28
0
110
AI と創る新たな世界 / A New World Created with AI
ks91
PRO
0
120
タクシーアプリ『GO』の実践的データ活用
mot_techtalk
3
160
Rancherの紹介&Update情報(RancherJP Online Meetup #09)
yoshiyuki_kono
0
120
速さだけじゃない! VoidZero ツールが移行先に選ばれる理由
mizdra
PRO
6
760
2026.06.13_AI時代に事業会社が「SIer出身エンジニア」を求める理由 / Why Businesses Seek Engineers with a System Integrator Background in the AI Era
jumtech
0
560
React、まだ楽しくて草
uhyo
7
4.1k
Featured
See All Featured
Designing for Performance
lara
611
70k
Optimising Largest Contentful Paint
csswizardry
37
3.7k
Test your architecture with Archunit
thirion
1
2.3k
First, design no harm
axbom
PRO
2
1.2k
The agentic SEO stack - context over prompts
schlessera
0
790
Producing Creativity
orderedlist
PRO
348
40k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
190
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
380
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.1k
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Paper Plane
katiecoart
PRO
1
51k
Transcript
Rustॳ৺ऀ ·ͣڝϓϩ͔Β࢝ΊͨΒ ྑͦ͞͏ͬͯ
ࣗݾհ • Kohno Fumiya ( @fnwiya ) • Japan Venture
Research Co., LTD. • React Native & Ruby on Rails • RustΛۀʹಋೖ͍ͨ͠ʢ͢Δʣ
৽͍͠ݴޠͷशಘʹ ࣗͷ࡞Γ͍ͨͷΛ࡞ΔաఔͰ ֶͿͷ͕ϕετ
ڝϓϩͱ ڝٕϓϩάϥϛϯάʢӳޠ: Competitive programmingɺུশ: ڝϓϩʣͱɺ ϓϩάϥϛϯάίϯςετͰߦΘΕΔڝٕͷҰछͰ͋Δɻ ڝٕϓϩάϥϛϯάͰɺࢀՃऀશһʹಉҰͷ՝͕ग़͞ΕɺΑΓૣ͘༩͑ ΒΕͨཁٻΛຬ͢ΔϓϩάϥϜΛਖ਼֬ʹهड़͢Δ͜ͱΛڝ͏ɻίϯϐϡʔλ αΠΤϯεֶͷࣝΛඞཁͱ͢Δ͕ଟ͘ɺ৽ଔֶੜͷ࠾༻׆ಈͳͲʹ ΘΕΔ͜ͱ͋Δɻଟ͘ͷίϯςετͰΦϯϥΠϯδϟοδ͕࠾༻͞Ε͍ͯ
Δɻ ·ͨɺڝٕϓϩάϥϛϯάʹࢀՃ͢ΔਓΛʮڝٕϓϩάϥϚʯ·ͨʮڝϓϩ erʯͱݺͿ͜ͱ͕͋Δɻ https://ja.wikipedia.org/wiki/ڝٕϓϩάϥϛϯά
ྫʣࣗવ a , b͕༩͑ΒΕ·͢ɻ a ͱ b ͷ͕ૉͳΒYes, ૉҎ ֎ͳΒNoΛग़ྗ͍ͯͩ͘͠͞ɻ
(a, b < 1000)
Rustacean͕ڝϓϩΛ͖͢ཧ༝ • ࡞Γ͍ͨͷ͕ͳ͕ͯ͋͘Δ • ڥߏஙෆཁ • Rustಛ༗ͳ͜ͱҰ௨Γ৮ΕΒΕΔ • String vs
Vec<char>ͳͲจࣈྻͷѻ͍ • ύλʔϯϚονɺmap().collect()ɺॴ༗ݖ • ࣮ߦ ≒ C++
RustͰڝϓϩ͢Δͱ͖ͷҙ • ඪ४ೖྗ use std::io::*; use std::str::FromStr; fn read<T: FromStr>()
-> 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
ڝϓϩͰʹ͔ͭͳ͍͜ͱ • ςετ • Ϟδϡʔϧ • νʔϜ։ൃ
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 ) ͕͓͢͢Ί
None