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
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
きのこカンファレンス2026_肩書きを外したとき私は誰か
yamasatimi
1
110
From Prompt Engineering to Loop Engineering
shibuiwilliam
1
310
Oracle Exadata Database Service on Cloud@Customer X11M (ExaDB-C@C) サービス概要
oracle4engineer
PRO
2
8.3k
AWS Summit Japan 2026の振り返りと2027へ向けて / AWS Summit Japan 2026 Recap and Prospects for 2027
kaminashi
1
150
スタートアップにおけるアジャイルの実践について #shibuyagile
murabayashi
2
820
4人目のSREはAgent
tanimuyk
0
320
Zenoh on Zephyr on LiteX
takasehideki
2
160
初めてのDatabricks勉強会
taka_aki
2
220
“ID沼入口” - 基本とセキュリティから始める、考え続けるためのID管理技術勉強会 告知&イントロ
ritou
0
340
AIで政治は変わるのか? — 中高生と考えたAI時代の民主主義(東海高校サタデープログラム)
eitarosuda
0
310
攻撃者がいなくてもAIエージェントはインシデントを起こす
nomizone
0
170
デジタル・デザイン構想 by Sayaka Ishizuka
y150saya
0
150
Featured
See All Featured
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
260
4 Signs Your Business is Dying
shpigford
187
22k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
65
56k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
320
WCS-LA-2024
lcolladotor
0
660
Building the Perfect Custom Keyboard
takai
2
800
Optimising Largest Contentful Paint
csswizardry
37
3.7k
WENDY [Excerpt]
tessaabrams
11
38k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.3k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
210
A Modern Web Designer's Workflow
chriscoyier
698
190k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
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