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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
odanado
PRO
June 11, 2018
Programming
860
0
Share
Perl5で競技プログラミング / Perl5-Competitive-Programming
Gotanda.pm #18 で使用した資料です
odanado
PRO
June 11, 2018
More Decks by odanado
See All by odanado
Vitest Browser Mode への期待 / Vitest Browser Mode
odanado
PRO
3
5.4k
@nestjs/bull の活用について
odanado
PRO
0
1.5k
クラウド KMS の活用 / TOKYO BLOCKCHAIN TECH MEETUP 2022
odanado
PRO
0
1.3k
Vue.observable で状態管理 / vue-observable-state-management
odanado
PRO
4
2.1k
nuxtjs-axios-error-handling
odanado
PRO
0
400
ブロックチェーンアプリのトランザクションに対するデータ分析 / PyCon-JP-2019
odanado
PRO
0
460
スマートコントラクトに対する既知の攻撃とその対策 / bc.tokyo-21
odanado
PRO
0
270
最近のweb3.js事情 / bc.tokyo-19
odanado
PRO
2
550
YAPC::Tokyo 2019に スタッフ参加してみて / kichijojipm-18
odanado
PRO
1
2.4k
Other Decks in Programming
See All in Programming
「速くなった気がする」をデータで疑う
senleaf24
0
150
AI時代のPhpStorm最新事情 #phpcon_odawara
yusuke
0
130
AI時代の脳疲弊と向き合う ~言語学としてのPHP~
sakuraikotone
1
1.8k
Don't Prompt Harder, Structure Better
kitasuke
0
460
10年分の技術的負債、完済へ ― Claude Code主導のAI駆動開発でスポーツブルを丸ごとリプレイスした話
takuya_houshima
0
1.8k
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
190
Symfony + NelmioApiDocBundle を使った スキーマ駆動開発 / Schema Driven Development with NelmioApiDocBundle
okashoi
0
270
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
290
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
130
YJITとZJITにはイカなる違いがあるのか?
nakiym
0
110
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
160
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.3k
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
GitHub's CSS Performance
jonrohan
1032
470k
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Paper Plane (Part 1)
katiecoart
PRO
0
6.5k
Claude Code のすすめ
schroneko
67
220k
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
400
A Tale of Four Properties
chriscoyier
163
24k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
510
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
220
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