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
June 11, 2018
Programming
880
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Perl5で競技プログラミング / Perl5-Competitive-Programming
Gotanda.pm #18 で使用した資料です
odanado
June 11, 2018
More Decks by odanado
See All by odanado
Vitest Browser Mode への期待 / Vitest Browser Mode
odanado
3
5.5k
@nestjs/bull の活用について
odanado
0
1.6k
クラウド KMS の活用 / TOKYO BLOCKCHAIN TECH MEETUP 2022
odanado
0
1.3k
Vue.observable で状態管理 / vue-observable-state-management
odanado
4
2.1k
nuxtjs-axios-error-handling
odanado
0
410
ブロックチェーンアプリのトランザクションに対するデータ分析 / PyCon-JP-2019
odanado
0
460
スマートコントラクトに対する既知の攻撃とその対策 / bc.tokyo-21
odanado
0
290
最近のweb3.js事情 / bc.tokyo-19
odanado
2
570
YAPC::Tokyo 2019に スタッフ参加してみて / kichijojipm-18
odanado
1
2.4k
Other Decks in Programming
See All in Programming
コーディングルールの鮮度を保ちたい for SRE NEXT 2026 / keep-fresh-go-internal-conventions-sre-next-2026
handlename
0
140
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
280
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
360
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
480
Claude Opus 4.6以後の受託開発エンジニアの変化(Claude Code開発ノウハウ大公開スペシャルbyクラスメソッド)
iidatakuma
1
500
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
480
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
240
Contextとはなにか
chiroruxx
1
390
スマートグラスで並列バイブコーディング
hyshu
0
290
AI時代の仕事技芸論〜ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ(スクフェス仙台 2026バージョン)
kuranuki
0
600
ビデオ通話が繋がる0.2秒で何が起きているのか
supurazako
2
130
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
8
3.9k
Featured
See All Featured
Become a Pro
speakerdeck
PRO
31
6k
A Soul's Torment
seathinner
6
3k
Technical Leadership for Architectural Decision Making
baasie
3
440
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
460
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
150
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
210
Faster Mobile Websites
deanohume
310
32k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.7k
HDC tutorial
michielstock
2
740
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Chasing Engaging Ingredients in Design
codingconduct
0
230
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