Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Rustで競技プログラミング
Search
rf-castle
July 08, 2022
61
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rustで競技プログラミング
rf-castle
July 08, 2022
More Decks by rf-castle
See All by rf-castle
Alter_Linuxのすすめ
rfcastle
0
170
Python_Parrotと学ぶPythonの並行実行.pdf
rfcastle
0
120
PythonParrotと学ぶPythonの並列実行
rfcastle
0
72
Nuxt jsに触れてみた
rfcastle
0
35
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Unsuck your backbone
ammeep
672
58k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
400
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.2k
First, design no harm
axbom
PRO
2
1.3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.2k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Transcript
RustでAtcoder 会津大学 田城幸太
自己紹介 • 会津大学 学部4年 • 田城幸太 • 通りすがりのPythonParrot(RustParrotに変身中) • STETCH,
Zli所属 • 嫁:羽黒(艦これ) • 妹:チノ(ごちうさ) • 相棒:キィラン(ゼノンザード) • Twitter: @kouta_tashiro
アジェンダ • 競技プログラミング・Atcoderってなぁに? • Rustってなぁに? • Why Rust? • Rustの勉強の仕方
• 便利ツール
競技プログラミング・Atcoderってなぁに? • 競技プログラミングでは、参加者全員に同一の課題が出題され、より早く与えられた要 求を満足するプログラムを正確に記述することを競う。 • (Wikipediaより引用) • 競技プログラミングコンテストサイト。 • コンテストと呼ばれ、決められた時間内にいかに多く・早く問題を解けるかを競う
• 良い成果を出すとレートが上がるレート制。 • ある程度レートが上がると色が付く。
実際に、 Atcoderの問題を 1つ解いてみましょう。
Atcoderとは? • 競技プログラミングサイト。 • 良い成果を出すとレートが上がるレート制。 • ある程度レートが上がると色が付く。 • 以下のコンテストが開かれている。 •
ABC:初心者向けコンテスト。土 or 日 の 21:00~に開かれている場合が多い。 • 制限時間100分 • ARC:中級者向けコンテスト。こちらも土 or 日 の 21:00開始が多い。 • 制限時間120分 • AGC:上級者向けコンテスト。不定期 • 制限時間180分 • かなりつよつよにならないと参加してもレート上がらない
Rustってなぁに? • プログラミング言語の一種。 • 特徴 • 静的型付け・コンパイラ言語 • コンパイラが優秀 •
型システムの推論が優秀 • 所有権システムによってGCなしのメモリ安全性 • イテレータやパターンマッチングなどの関数型言語の要素 • OptionやResultによるエラーハンドリング
Why Rust? • C/C++と同等以上の実行速度 • Pythonでやると、アルゴリズム的に正しくても、実行速度が不足して TLE(時間制限超過)になってしまいやすい • C/C++のような未定義動作がない
はじめよう。Rust • Rust books • Rustの公式チュートリアル。まずはここから! • https://doc.rust-jp.rs/book-ja/title-page.html • Rust
Examples • Rustのコード集。かゆいところに手が届く。 • https://doc.rust-jp.rs/rust-by-example-ja/ • Rustlings • 実践的な問題集、手を動かしながら覚えたいならこれ! • https://github.com/rust-lang/rustlings • Atcoder Beginner Contest • だいぶ慣れてきたら挑戦してみよう。 • 過去問も公開されているから、それを解くのもヨシ!
便利にしよう。Rustでの競技プログラミング。 • cargo-compete • プロジェクト作成、コードの自動テスト・提出をしてくれるCLI。
やってみた結果。 • 茶コーダーになりました(3/26)。 緑コーダーになりたいです。
まとめ • C++も良いが、たまにはRustで競プロしようぜ • 明日 21:00~からAtcoder Beginner Contestあるからみんな出ようね