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
Perl5で競技プログラミング / Perl5-Competitive-Programming
Search
odanado
PRO
June 11, 2018
Programming
0
770
Perl5で競技プログラミング / Perl5-Competitive-Programming
Gotanda.pm #18 で使用した資料です
odanado
PRO
June 11, 2018
Tweet
Share
More Decks by odanado
See All by odanado
Vitest Browser Mode への期待 / Vitest Browser Mode
odanado
PRO
3
3.5k
@nestjs/bull の活用について
odanado
PRO
0
1.3k
クラウド KMS の活用 / TOKYO BLOCKCHAIN TECH MEETUP 2022
odanado
PRO
0
1.1k
Vue.observable で状態管理 / vue-observable-state-management
odanado
PRO
4
2k
nuxtjs-axios-error-handling
odanado
PRO
0
320
ブロックチェーンアプリのトランザクションに対するデータ分析 / PyCon-JP-2019
odanado
PRO
0
370
スマートコントラクトに対する既知の攻撃とその対策 / bc.tokyo-21
odanado
PRO
0
210
最近のweb3.js事情 / bc.tokyo-19
odanado
PRO
2
460
YAPC::Tokyo 2019に スタッフ参加してみて / kichijojipm-18
odanado
PRO
1
2.2k
Other Decks in Programming
See All in Programming
SwiftUI Viewの責務分離
elmetal
PRO
1
240
PHPカンファレンス名古屋2025 タスク分解の試行錯誤〜レビュー負荷を下げるために〜
soichi
1
210
Flutter × Firebase Genkit で加速する生成 AI アプリ開発
coborinai
0
160
楽しく向き合う例外対応
okutsu
0
150
Domain-Driven Transformation
hschwentner
2
1.9k
AIの力でお手軽Chrome拡張機能作り
taiseiue
0
170
pylint custom ruleで始めるレビュー自動化
shogoujiie
0
120
Spring gRPC について / About Spring gRPC
mackey0225
0
220
XStateを用いた堅牢なReact Components設計~複雑なClient Stateをシンプルに~ @React Tokyo ミートアップ #2
kfurusho
1
910
Conform を推す - Advocating for Conform
mizoguchicoji
3
690
Writing documentation can be fun with plugin system
okuramasafumi
0
120
第3回 Snowflake 中部ユーザ会- dbt × Snowflake ハンズオン
hoto17296
4
370
Featured
See All Featured
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Optimizing for Happiness
mojombo
376
70k
Fireside Chat
paigeccino
34
3.2k
Docker and Python
trallard
44
3.3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
366
25k
How GitHub (no longer) Works
holman
314
140k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
1k
Testing 201, or: Great Expectations
jmmastey
42
7.2k
Thoughts on Productivity
jonyablonski
69
4.5k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Transcript
Perl5で競技プログラミング 2018-06-11 Gotanda.pm #18 1
自己紹介 • 所属: 株式会社モバイルファクトリー • GitHub: odanado • Twitter: @odan3240
• Perl5歴 ◦ 2ヶ月 • 趣味 ◦ 競技プログラミング ◦ ポケモン関係のツールを作ること ▪ poke2vec ▪ rng-api ◦ Slack bot作り 2 ↓Twitterアイコン
祝 gotanda.pm.org の https化 3
祝 gotanda.pm.org の https化 4
祝 gotanda.pm.org の https化 5
祝 gotanda.pm.org の https化 6
祝 gotanda.pm.org の https化 7
祝 gotanda.pm.org の https化 8
今日話すことのモチベーション 9
今日話すことのモチベーション 配列外参照でdieしてほしい! 10
競技プログラミングとは 11
競技プログラミングとは • 与えられた仕様を満たすような プログラムをコーディングする競技 12
競技プログラミングとは • 与えられた仕様を満たすような プログラムをコーディングする競技 問題文 13
競技プログラミングとは • 与えられた仕様を満たすような プログラムをコーディングする競技 ソースコード 14
競技プログラミングとは • 与えられた仕様を満たすような プログラムをコーディングする競技 正当性の検証 15
会社の競技プログラミング部の 活動でのある日 16
競技プログラミング部でのある日 • Perlプログラムを実行すると謎のエラーが出る • この時Perl歴1ヶ月弱ぐらい ◦ デバッグした結果、原因は配列外参照 • つらい... 17
> Use of uninitialized value in addition hogehoge <
Perl5での 競技プログラミングのつらさ 18
Perl5での競技プログラミングのつらさ • 配列外参照でdieしない ◦ “Use of uninitialized value in addition
hogehoge” • 標準ライブラリに便利なデータ構造が揃ってない ◦ C++におけるSTLのvector,set,map,deque など 19
Perl5での競技プログラミングのつらさ • cpanはすごい ◦ ライブラリが豊富 ◦ 便利そうなライブラリをcpanで探す? ▪ ダメ。 •
AtCoderの提出事情 (ほとんどの競プロサイトはそう) ◦ AtCoderへの提出はソースコードのコピペ ◦ 実行はAtCoderのサーバ上 ▪ Perl 5.18.2 が動いているだけ ◦ 標準ライブラリ以外を使うなら全てをコピペ 20
Perl5での競技プログラミングのつらさ • cpanはすごい ◦ ライブラリが豊富 ◦ 便利そうなライブラリをcpanで探す? ▪ ダメ。 •
AtCoderの提出事情 (ほとんどの競プロサイトはそう) ◦ AtCoderへの提出はソースコードのコピペ ◦ 実行はAtCoderのサーバ上 ▪ Perl 5.18.2 が動いているだけ ◦ 標準ライブラリ以外を使うなら全てをコピペ 21
いい感じの競技プログラミング 向けのライブラリがほしい 22
自作した 23
自作した • GitHub: odanado/p5-Procon • C++のSTLにあるやつはI/Fを真似る • 実装済み ◦ Vector
◦ UnorderedSet ◦ UnorderedMap ◦ UnionFind • 未実装 ◦ Deque ◦ Stack ◦ Queue ◦ PriorityQueue ◦ etc... 24
自作した • t/01_vector.t 25
まとめ 26
まとめ • 競技プログラミングはソースコードをコピペで提出 ◦ 基本的に標準ライブラリ以外のライブラリは使用不可 ◦ ライブラリもまとめてコピペ • Perl5で競技プログラミングするのに 便利なライブラリを開発した
◦ I/FはC++のSTLを真似た • データ構造/アルゴリズムをゴリゴリ実装していく予定 • Webサイトも作りたい 27