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
68
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Rustで競技プログラミング
rf-castle
July 08, 2022
Transcript
12 slides
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あるからみんな出ようね
More Decks by rf-castle
See All by rf-castle
Alter_Linuxのすすめ
rfcastle
0
180
Python_Parrotと学ぶPythonの並行実行.pdf
rfcastle
0
120
PythonParrotと学ぶPythonの並列実行
rfcastle
0
78
Nuxt jsに触れてみた
rfcastle
0
38
Featured
See All Featured
Game over? The fight for quality and originality in the time of robots
wayneb77
1
340
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
490
Leo the Paperboy
mayatellez
11
2.5k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.5k
How to Think Like a Performance Engineer
csswizardry
28
3k
Discover your Explorer Soul
emna__ayadi
2
1.4k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
1
320
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.7k
Code Reviewing Like a Champion
maltzj
529
40k
GraphQLとの向き合い方2022年版
quramy
50
15k
The Art of Programming - Codeland 2020
erikaheidi
57
15k