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
前回の”どう書く”を もっと高速にしてみた 2019.4.17 Nagoya.php #15
Search
inaka-phper
April 18, 2019
Technology
590
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
前回の”どう書く”を もっと高速にしてみた 2019.4.17 Nagoya.php #15
inaka-phper
April 18, 2019
More Decks by inaka-phper
See All by inaka-phper
低リスクで小学生男児を鍵っ子にする 俺の勉強会#4
inakaphper
0
350
技術習得の時間を作る
inakaphper
1
750
Other Decks in Technology
See All in Technology
AIカンパニーへの転換を支えた、エンジニアの仕事の再定義
kworkdev
PRO
2
1.4k
dbt Semantic Layerで進めるenechainのデータ民主化
akizhou
1
150
NDIでApple Vision Proにリアルタイム映像送信
jyouryuusui
0
140
S3 Filesで挑む! 八戸せんべい汁の食べ頃問題
usanchuu
0
130
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
210
ソフトウェア ファクトリー - 再現性のあるソフトウェアの工場づくり / Software factory
iktakahiro
7
5.2k
AI コーディングと人間の認知スループット / CTO Night & Day 2026 Morning Session / AI Coding and Human Cognitive Throughput
prog893
5
1.4k
FinOps Agentが生んだ技術負債:コスト自動調査の落とし穴と解消までの道のり
oasis1994liveforever
2
190
M5Stackで作る BLEマウス GPSログの世界
tomokusaba
PRO
0
450
Optunaの最新リリースv5.0について
pfn
PRO
0
120
Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件
riyaamemiya
0
210
Turning Repos into the Product Second Brain with an LLM Wiki
linedevth
0
110
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
760
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
580
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
320
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.1k
Agile that works and the tools we love
rasmusluckow
331
22k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
280
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
480
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
570
Transcript
લճͷ”Ͳ͏ॻ͘”Λ ͬͱߴʹͯ͠Έͨ 2019.4.17 Nagoya.php #15
·ͣࣗݾհ
ͱ͋Δాࣷͷphper @inaka_phper phpྺ16(࣮ྗ͕͍ͬͯΔ͔ผ) 3લʹ۽ຊ͔Β໊ݹస৬͖ͯ͠·ͨ͠ɻ 4ࡀࣇͱ1ࡀࣇͷ ՈͰͷझຯ։ൃ͢Δ࣌ؒΛͲ͏೧ग़͢Δ͔͕࠷ۙͷΈ
લճͷΛ͓͞Β͍
IUUQOBCFUBOJTBLVSBOFKQIFOBPSEFQBMJO
ૉʹղ͍ͯ… public function run(string $input): int { $args = explode(",",
$input); $start = (int)$args[0]; $end = (int)$args[1]; $tobase = (int)$args[2]; $visibleCounter = 0; for ($i = $start; $i < $end; $i++) { $number = base_convert($i, 10, $tobase); if ($number === strrev($number)) { $visibleCounter++; } } return $visibleCounter; }
λΠϜΞτ phper:NagoyaPhp14 phper$ composer test > vendor/bin/phpunit PHPUnit 7.5.7 by
Sebastian Bergmann and contributors. ...................... [Symfony\Component\Process\Exception\ProcessTimedOutException] The process "vendor/bin/phpunit" exceeded the timeout of 300 seconds.
λΠϜΞτͷݪҼ ['12345,987654321,2', 62684], ['2467130,8433468,2', 2902], ['323901,4712975,10', 4389], ['12345,987654321,36', 67446], ['3969344,4086910,24',
205], ['19743263,83912295,5', 11553], ['6349529,39870823,10', 6637], ['66160071,153732445,5', 5605], ['18799557,189007582,14', 33741], ['78547566,225312226,20', 18346], ['143084571,506549072,18', 62323], ['2099642384,2789567569,6', 14787], ࢦఆͷςετέʔεͰَϧʔϓ͕ൃੜ͢Δ
ߴԽ͢Δʹ ϧʔϓΛݶք·ͰݮΒ͢͜ͱ
IUUQTTQFBLFSEFDLDPNUUTLDIKJOSJGBMTFUPVTIVLVXFOUJGBMTFBSVLPSJTVNVMJ TMJEF Ҏ߱ɺ్த·Ͱ͖ͨͭͪ͞ΜͱҰॹ
લճɺ୭͕ࢥͬͨͣ… ܭࢉͰग़དྷΔͷͰʁ
ݕূͨ݁͠Ռ
ܭࢉͰ͍͚·ͨ͠ɻ
ςετέʔε݁Ռ phper:NagoyaPhp14 phper$ composer test > vendor/bin/phpunit PHPUnit 7.5.7 by
Sebastian Bergmann and contributors. .................................. 34 / 34 (100%) Time: 47 ms, Memory: 4.00 MB OK (34 tests, 34 assertions) phper:NagoyaPhp14 phper$
υϠΝʂʂ phper:NagoyaPhp14 phper$ composer test > vendor/bin/phpunit PHPUnit 7.5.7 by
Sebastian Bergmann and contributors. .................................. 34 / 34 (100%) Time: 47 ms, Memory: 4.00 MB OK (34 tests, 34 assertions) phper:NagoyaPhp14 phper$
Ͳ͏ܭࢉͨ͠ͷ͔ʁ
10000-99999ͰճจͱͳΔ Λग़ྗͯ͠๏ଇΛ୳Δ (10ਐ)
10000-99999ͰճจΛग़ྗ 10101 10201 10301 10401 10501 10601 10701 10801 10901
11011 11111 11211 11311 11411 11511 11611 11711 11811 11911 12021 … 99099 99199 99299 99399 99499 99599 99699 99799 99899
10000-99999ͰճจΛग़ྗ 10101 10201 10301 10401 10501 10601 10701 10801 10901
11011 11111 11211 11311 11411 11511 11611 11711 11811 11911 12021 … 99099 99199 99299 99399 99499 99599 99699 99799 99899 ࠨͷ͕ͭͣͭ૿͑ͯΔ
࠷ޙ - ։࢝ = ճจग़ݱ
࠷ޙ 99999 ࠷ॳ 10000 999 - 100 = 899
None
ߟྀ͖͢έʔε
ఆ͞ΕΔߟྀ͠ͳ͍ͱ͍͚ ͳ͍ࣄ 1. phpnਐͷ··ܭࢉͰ͖ͳ͍ 2. ӈͷ։࢝ɾ࠷ޙͷҐஔʹΑͬͯޡ͕ࠩ ग़Δ 3. ح͔Βۮͷ܁Γ্͕Γͷࠨ…
php nਐͷ··ܭࢉͰ͖ ͳ͍ ໘͕ͩมͯ͠͠ճආ 1. ࢦఆͷnਐม 2. ࠨΛΓग़͢ 3. Γग़ͨ͠ࠨΛ10ਐ
255 -> ff ff -> f f -> 15
ӈͷ։࢝ɾ࠷ޙͷҐஔʹ Αͬͯޡ͕ࠩग़Δ 10000ͷࠨ 10099ͷࠨ ಉ͡100͕ͩޙऀ10001ཱ͕͠ͳ͍ ࠷ॳͱ࠷ޙࠨͷճจͷൣғ͔νΣοΫ
ح͔Βۮͷ܁Γ্͕Γ ͷࠨ… 10000 … 99999 100000 ܁Γ্͕ͬͨͷʹࠨ͚ͩͰݟΔͱॳظʹͬͯ͠·͏ ͜ͷλΠϛϯάͰҰ୴ 999 -
100Λͯ݁͠ՌΛੵΈ্͛ͯճආ
͜ΕΒͷରࡦͰ όονϦͰͨ͠