Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
競プロへの誘 -いざな-
Search
U76NER
May 16, 2022
Programming
1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
競プロへの誘 -いざな-
WASD Inc. LT会(仮)
2022-03-25
U76NER
May 16, 2022
More Decks by U76NER
See All by U76NER
JSのクラスの後ろ向きな話
u76ner
0
140
GASええやん
u76ner
1
110
mockdateええやん
u76ner
0
330
Other Decks in Programming
See All in Programming
baseline으로 마이그레이션, 리팩토링 안전하게 맡기기
fornewid
1
910
Coding with AI: How to trust the storyteller (AWS Community Day Adria, Ljubljana 2026)
slobodan
0
140
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
150
エージェントを使い続けるためのメタワーク / Meta-work for keeping using the agent
rkaga
6
2.2k
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
230
コーディング自動化の次へ。人の介入をゼロにするファクトリーとサポートAIによる実践
timakin
5
5.1k
graphql-ruby を Spinel で速くしようとした話
mtsmfm
0
140
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
290
AI Augmentation Techniques with Liberty
ivargrimstad
1
380
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
180
Будущее локальных LLM – Алексей Голобурдин, PythoNN
sobolevn
0
110
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
110
Featured
See All Featured
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.8k
Statistics for Hackers
jakevdp
799
230k
It's Worth the Effort
3n
188
29k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
630
How to build a perfect <img>
jonoalderson
1
6.2k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Large-scale JavaScript Application Architecture
addyosmani
516
110k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
480
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
What's in a price? How to price your products and services
michaelherold
247
13k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Transcript
競プロへの誘 -いざな- LT会(仮) 2022/03/25 u76ner
競プロとは 2 - 競プロとは - 「競技プログラミング」の略 - 競技プログラミングでは、参加者全員に同一の課題が出題され、より早く与えら れた要求を満足するプログラムを正確に記述することを競う。
(Wikipedia)
競プロとは 3 - 有名なやつの例 - AtCoder
競プロとは 4 - 有名なやつの例 - AIZU ONLINE JUDGE(AOJ)
競プロとは 5 - 問題の入力に対して解答に制限時間内に解答する - だいたい2秒とかが多い気がする(↓ AtCoderでの例)
競プロとは 6 - 問題の入力に対して解答に制限時間内に解答する
競プロとは 7 - 問題の入力に対して解答に制限時間内に解答する - 問題を解くこと自体は原理的にできるが、 ナイーブに実装すると現実的な時間で解くことが不可能 であることが多い
計算量の例 8 - 例) - a n+2 = a n+1
+ a n , a 1 = 1, a 2 = 1 - このとき、a 40 , a 100 を求めよ - いわゆるフィボナッチ数列
計算量の例 9 - ナイーブな実装
計算量の例 10 - ナイーブな実装 - a 100 が計算できない
- 計算時間 - a 40 : 604 ms - a 45 : 6,808 ms - a 50 : > 1 min
計算量の例 11 - 改善点 - a 50 = a
49 + a 48 = (a 48 + a 47 ) + (a 47 + a 46 ) = (a 47 + a 46 ) + (a 46 + a 45 ) + (a 46 + a 45 ) + (a 45 + a 44 ) = …
計算量の例 12 - 改善点 - a 50 = a
49 + a 48 = (a 48 + a 47 ) + (a 47 + a 46 ) = (a 47 + a 46 ) + (a 46 + a 45 ) + (a 46 + a 45 ) + (a 45 + a 44 ) = … - 重複した計算を上手く記憶しておくことで速くできそう
計算量の例 13 - 途中計算を記憶しておく実装
計算量の例 14 - 途中計算を記憶しておく実装 - 計算時間 -
a 40 : ≒ 1ms - a 100 : ≒ 1ms - ちなみにこういうアルゴリズムを総称して動的計画法(DP)という
エンジニアの視点から 15 - 競プロをやることの利点
エンジニアの視点から 16 - 競プロをやることの利点 - 処理を軽くすることに目が向きやすい
エンジニアの視点から 17 - 例)
エンジニアの視点から 18 - ナイーブにやる - 二重ループは改善できそう
エンジニアの視点から 19 - 連想配列を使う -
二重ループが解消できる
まとめ 20 - 競プロでは、計算方法自体はすぐわかるけど、 それを現実的な時間で計算できるかが求められる - 普段の実装でも、細かい計算量の削減に目が行き届くようになる
21