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
How to automate competition programming
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Dassimen
November 24, 2019
Programming
290
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
How to automate competition programming
こちらのLT資料です。
https://gigacode.connpass.com/event/153119/
Dassimen
November 24, 2019
More Decks by Dassimen
See All by Dassimen
Write code with "Test First"
anchorcable
0
72
Trying AWS Aurora Serverless.
anchorcable
0
240
Dialogue for Design
anchorcable
1
340
How to manage a good work environment
anchorcable
0
130
TDD is not slowly.
anchorcable
1
630
3日坊主でも勉強したい
anchorcable
5
6k
Design It! is good for architect.
anchorcable
0
150
今だからこそ分かる報連相 / How to do Hou/Ren/Sou!
anchorcable
0
800
TDD supports us all the time.
anchorcable
0
390
Other Decks in Programming
See All in Programming
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
1
260
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
190
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
3
770
yield再入門 #phpcon
o0h
PRO
0
980
数百円から始めるRuby電子工作
tarosay
0
140
仕様駆動開発の消費期限
watany
16
7.3k
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
620
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
480
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
220
プロポーザルを書いてもらう
pvcresin
0
290
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
160
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
220
Featured
See All Featured
Paper Plane (Part 1)
katiecoart
PRO
1
10k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
370
The Curse of the Amulet
leimatthew05
2
14k
BBQ
matthewcrist
89
10k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
66
57k
AI: The stuff that nobody shows you
jnunemaker
PRO
9
890
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
390
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Claude Code のすすめ
schroneko
67
230k
Navigating Weather and Climate Data
rabernat
0
460
Transcript
Performanceを上げたいので 自動化してみました Nov 24, 2019 | #dasshimen #GigaCode2019 提出、テスト、そんなものは自動化だ! 脱脂綿
( @anchor_cable )
#GigaCode2019 2 About Me 脱脂綿 ( @anchor_cable ) 東京都内に住む脱脂綿(=Twitter名)系エンジニア •
株式会社ゆめみ ◦ サーバーサイドエンジニア ◦ 7月1日入社 • AtCoder登録は1年前
3 アジェンダ テストと提出を自動化する方法 自動化した結果どうなるのか Performanceを上げるには? 1 2 3 #GigaCode2019
Performanceを上げるには? 1
5 Performanceを上げるには? なるべく多くの問題を早く解かねばならない(今更感) AtCoder Beginner Contestの場合、 A問題とB問題を合わせて5分以内に解くのが目安 A B C
D E F #GigaCode2019
6 そうはいっても大変 そもそもやることが多い 1.問題文を読んで理解する 2.ローカルにファイルを用意する 3.コードを書く 4.実行する 5.サンプル入力を入力する 6.実行結果がサンプル結果と一致するか確かめる 7.ブラウザから提出する
#GigaCode2019
7 簡略化できる 自動化を導入すれば 1.問題文を読んで理解する 2.ローカルにファイルを用意する → 自動で作業ファイルを作成 3.コードを書く 4.実行する 5.サンプル入力を入力する
→ 自動テスト 6.実行結果がサンプル結果と一致するか確かめる 7.ブラウザから提出する → CLIからコマンドで提出できる #GigaCode2019
テストと提出を自動化する方法 2
9 自動化する方法 ツールを3つ入れてみた • online-judge-tools • atcoder-cli • Dash #GigaCode2019
10 online-judge-tools サンプル自動取得+自動テスト+自動提出 ほとんどの競プロerが使った事あるであろうツール。人権。 AtCoderの各問題に記載されている入力例、出力例を取得し、 コマンド1回で自動テストしてくれる。 もう手動で実行して、手動で入力を入れる必要はなくなった! #GigaCode2019
11 atcoder-cli online-judge-toolsのラッパーツール(AtCoder特化) online-judge-toolsは他の競プロコンテストにも対応している都合上、コマンドが長い atcoder-cliを使う事で、コマンドがかなり短縮される テンプレートファイルを自動配置する機能もある 短いコマンドで全て自動化! 問題に取り掛かる時 acc new ABC144
問題をテストする時 oj test -c "python3 main.py" 問題を提出する時 acc s #GigaCode2019
12 Dash スニペットツール(入力支援ツール) oj test -c "python3 main.py" コマンドがまだ長いので、 ;oj#
で出るようにした ついでに競プロのよく使う構文も登録してみた よく使う構文を登録していく事で、 そこで考えるコストがゼロになった #GigaCode2019
自動化した結果どうなるのか 3
14 出た成果 ABC145 Performance:822 ABC144 Performance:601 #GigaCode2019 ABC142時点でPerformance:157
15 単純な時短以外にも恩恵 気持ちの余裕が生まれる (テストで)1発で正解しないコードでも落ち着いて見返せるようになった 若干不安な部分でも、とりあえず実装してみてテスト通す 問題を解く事に全てのリソースを集中できる #GigaCode2019
16 初心者こそ無駄な所を自動化しよう #GigaCode2019 導入前 「自分にはツールはまだ早いでしょ」 「環境整備しても実力が...」 「アルゴリズムの勉強のが先かな」
17 初心者こそ無駄な所を自動化しよう #GigaCode2019 導入前 「自分にはツールはまだ早いでしょ」 「環境整備しても実力が...」 「アルゴリズムの勉強のが先かな」 導入後 「もっと早くやってればよかった」 「過去問解くのも楽しい!」
→要は良いIDEや良いPC揃えるのと同じ
18 まとめ リラックスして本当の実力を引き出そう 初心者こそ自動化の恩恵を受けよう ツールを入れて手動作業を自動化しよう 1 2 3 #GigaCode2019
ご清聴ありがとうございました
20 参考リンク Atcoder環境をatcoder-cli + online-judge-tools + Dashで構築する https://qiita.com/anchor-cable/items/98a0bf669513d47972d4 AtCoder に登録したら次にやること
~ これだけ解けば十分闘える!過去問精選 10 問 ~ https://qiita.com/drken/items/fd4e5e3630d0f5859067 #GigaCode2019