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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
3k
WebAssembly future
fnwiya
0
2.3k
Other Decks in Technology
See All in Technology
Model Studio CLI × Token Plan
maigo999
0
180
モダンフロントエンド 開発研修
recruitengineers
PRO
4
660
Webアクセシビリティ入門 2026
recruitengineers
PRO
3
580
グローバル基準のSREは、運用現場でどう機能したか:成熟度アセスメントの実践 / SRE NEXT 2026
sorawatanabe
0
240
関東Kaggler会発表資料
takoi
1
230
Head First モブプログラミング / Head First Mobprogramming
takaking22
10
12k
ブラウザ研修 2026
recruitengineers
PRO
6
1k
TypeScript入門 2026
recruitengineers
PRO
3
590
JavaScript 研修 (2026)
recruitengineers
PRO
2
550
DatadogのBits Chatが開発組織にもたらしたもの / What Bits Chat Has Brought Us
sms_tech
1
270
同じWAFが、攻撃の“形”は弾く── 正当な“形”の不正は通す
kuroneko13
0
200
今こそ聞きたいソフトウェア設計 ドメイン駆動設計再入門
masuda220
PRO
17
7.4k
Featured
See All Featured
Google's AI Overviews - The New Search
badams
0
1.1k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Visualization
eitanlees
152
17k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
Building the Perfect Custom Keyboard
takai
2
840
WCS-LA-2024
lcolladotor
0
800
Un-Boring Meetings
codingconduct
0
390
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
330
エンジニアに許された特別な時間の終わり
watany
108
250k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
Typedesign – Prime Four
hannesfritz
42
3.1k
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