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
690
Perl5で競技プログラミング / Perl5-Competitive-Programming
Gotanda.pm #18 で使用した資料です
odanado
PRO
June 11, 2018
Tweet
Share
More Decks by odanado
See All by odanado
@nestjs/bull の活用について
odanado
PRO
0
1k
クラウド KMS の活用 / TOKYO BLOCKCHAIN TECH MEETUP 2022
odanado
PRO
0
830
Vue.observable で状態管理 / vue-observable-state-management
odanado
PRO
4
1.8k
nuxtjs-axios-error-handling
odanado
PRO
0
260
ブロックチェーンアプリのトランザクションに対するデータ分析 / PyCon-JP-2019
odanado
PRO
0
290
スマートコントラクトに対する既知の攻撃とその対策 / bc.tokyo-21
odanado
PRO
0
170
最近のweb3.js事情 / bc.tokyo-19
odanado
PRO
2
410
YAPC::Tokyo 2019に スタッフ参加してみて / kichijojipm-18
odanado
PRO
1
2.1k
JavaScript + Dockerの知見 / knowledge-of-docker-in-javascript
odanado
PRO
9
53k
Other Decks in Programming
See All in Programming
Tailwind CSSを本気でカスタマイズする方法
fsubal
13
5.3k
Hanami and htmx
bkuhlmann
0
210
大規模UIKitベースアプリへのTCAの段階的導入/gradual-adoption-of-tca-in-a-large-scale-uikit-based-app
takehilo
1
180
PostmanでAPIの動作確認が楽になった話
h455h1
0
170
大規模Reactアプリのリアーキテクチャ~8万行のTanStack Query移行の軌跡~
kj455
4
960
Zero Waste, Radical Magic, and Italian Graft – Quarkus Efficiency Secrets
hollycummins
0
230
Amazon SQSコンシューマー疎結合への旅 - 出張! #DevelopersIO IT技術ブログの中の人が語る勉強会 #3
quiver
0
270
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
130
Code Reviews
bkuhlmann
4
890
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
330
Elm Form Validation
bkuhlmann
0
510
Git Lint
bkuhlmann
4
750
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
17
6.4k
GitHub's CSS Performance
jonrohan
1025
450k
RailsConf 2023
tenderlove
4
540
The Mythical Team-Month
searls
216
42k
Become a Pro
speakerdeck
PRO
11
4.5k
The Language of Interfaces
destraynor
151
23k
VelocityConf: Rendering Performance Case Studies
addyosmani
320
23k
Principles of Awesome APIs and How to Build Them.
keavy
121
16k
We Have a Design System, Now What?
morganepeng
43
6.8k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
17
1.4k
Typedesign – Prime Four
hannesfritz
36
2.1k
How STYLIGHT went responsive
nonsquared
92
4.8k
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