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
830
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
4.9k
@nestjs/bull の活用について
odanado
PRO
0
1.5k
クラウド KMS の活用 / TOKYO BLOCKCHAIN TECH MEETUP 2022
odanado
PRO
0
1.2k
Vue.observable で状態管理 / vue-observable-state-management
odanado
PRO
4
2.1k
nuxtjs-axios-error-handling
odanado
PRO
0
360
ブロックチェーンアプリのトランザクションに対するデータ分析 / PyCon-JP-2019
odanado
PRO
0
430
スマートコントラクトに対する既知の攻撃とその対策 / bc.tokyo-21
odanado
PRO
0
250
最近のweb3.js事情 / bc.tokyo-19
odanado
PRO
2
520
YAPC::Tokyo 2019に スタッフ参加してみて / kichijojipm-18
odanado
PRO
1
2.3k
Other Decks in Programming
See All in Programming
目的で駆動する、AI時代のアーキテクチャ設計 / purpose-driven-architecture
minodriven
7
1.8k
レイトレZ世代に捧ぐ、今からレイトレを始めるための小径
ichi_raven
0
350
競馬で学ぶ機械学習の基本と実践 / Machine Learning with Horse Racing
shoheimitani
13
13k
DartASTとその活用
sotaatos
2
130
Nitro v3
kazupon
2
310
PHPライセンス変更の議論を通じて学ぶOSSライセンスの基礎
matsuo_atsushi
0
150
Dive into Triton Internals
appleparan
0
500
[堅牢.py #1] テストを書かない研究者に送る、最初にテストを書く実験コード入門 / Let's start your ML project by writing tests
shunk031
2
1.5k
早すぎ?超先読み Go 1.26 Draft - Preview the contents of the Go 1.26 Draft Release Notes
tomtwinkle
0
260
ゼロダウンタイムでミドルウェアの バージョンアップを実現した手法と課題
wind111
0
190
しっかり学ぶ java.lang.*
nagise
1
380
The Missing Link in Angular's Signal Story: Resource API and httpResource
manfredsteyer
PRO
0
130
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
A Modern Web Designer's Workflow
chriscoyier
697
190k
Scaling GitHub
holman
463
140k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
24
1.6k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
192
56k
The World Runs on Bad Software
bkeepers
PRO
72
12k
[RailsConf 2023] Rails as a piece of cake
palkan
57
6.1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.7k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
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