SlideShare uma empresa Scribd logo
1 de 83
Hacks
@cou929
Agenda
•

•

•

    •

    •

    •

    •

    •

    •

•
@cou929

•           (               )

• web

• Web technologies

    • HTML + CSS + JavaScript
•

•

• a.k.a.

    •

    •

    • etc.
.
    n                                .                                      ,
                         4               .             m
                 .                                                      .
                             ,                     ,
                                 .                         k_1, k_2, ..., k_n
             ,       m                                      ,
    ”Yes”,               ”No”                                   .



1 <= n <= 50
1 <= m <= 10^8
1 <= k_i <= 10^8
•                                            1-1
• n = 3, m = 10, k = {1, 2, 3, 5}

 • “Yes” ({1, 1, 3, 5}   )




• n = 3, m = 9, k = {1, 3, 5}

 • “No”
•


•



•



    •
•


    •


•4


    •     n      50



    • 1 <= n <= 1000   ?
TopCoder
•                     (       2, 3   )

    •                     !

• 1         2   3

•               (C++, Java, C#, VB)

•

• TopCoder

        •

        •       NASA

• http://www.topcoder.com/tc
Google Code Jam
•

• 2        3

    •                      2

•

• Google

    •             ?

• http://code.google.com/codejam
ACM ICPC
•

•

•

•

•                           ><

• http://cm.baylor.edu/welcome.icpc
• CodeForces

  • http://codeforces.ru/

• CodeChef

  • http://www.codechef.com/

• ICFP Programing Contest

  • http://icfpcontest.org/

• etc.
•            ,

    • ICPC

•

    •

•

•
• PKU Judge Online

 • http://acm.pku.edu.cn/JudgeOnline/

• Sphere online judge

 • http://www.spoj.pl/

• AIZU Online Judge

 • http://rose.u-aizu.ac.jp/onlinejudge/
•

•

•

•

•

•
•

    •   ,   ,

•

    •

    •

•

    •
•

•

•
•       “   ”

    •

    •
                ,

•
•

•

•
•   ->   ->   ! ->



•   ->   ->          !




•

•
•             ->    ->
    ->             ->    ->
         ->




•

•
•

    •   O-

•

•
O-
•

    •     O(log n), O(n^3)

•

    •

    •

    • 3   -> O(n^3)          !

•

    •           .
•                 ,n        50

•                  O(n^4)

    • 6,250,000
•          2


     1,000,000

    100,000,000

    1,000,000,000
•

•

    •     (dfs)

    •   (bfs)

•

    •

    •
:
 • O(n^4)

 • n=3



               n1                  n2             n3



     n1        n2   n3        n1   n2   n3   n1   n2   n3



n1   n2   n3        n1   n2   n3    ……
                               ……
•   http://www.itmedia.co.jp/enterprise/articles/1001/16/news001.html
•   ,



•

•
:
     a1, a2, ..., an       .             ,
         k                           .



1 <= n <= 20
- 10^8 <= a_i <= 10^8
- 10^8 <= k <= 10^8



n=4
a = {1, 2, 4, 7}
k = 13

"Yes" (2 + 4 + 7)


•                              2-1
•          a_i         ,   /

•        a_i



•          O(2^n)

•n             20

• 2 ^ 20 = 1,048,576
•   “                            :                       -        ”   (http://
    www.itmedia.co.jp/enterprise/articles/1001/16/news001.html)
•

    • dfs

•

    • dfs                bfs

      •

•           O(   *   )
:

•
     :



• http://okajima.air-
  nifty.com/b/2010/01/
  post-abc6.html
:



                         ,         N, M                   .
N = M = 50




• http://okajima.air-nifty.com/b/2010/01/post-abc6.html
:
                   **************************
                   *S* *                       *
                   * * * * ************* *
                   * *     *      ************ *
                   *     *                     *
                   ************** ***********
                   *                           *
                   ** ***********************
                   *         *               G *
                   * *           *********** * *
                   *     *           ******* * *
                   *           *               *
                   **************************


• http://okajima.air-nifty.com/b/2010/01/post-abc6.html
:
                   **************************
                   *S* * $$$                *
                   *$* *$$*$ ************* *
                   *$* $$* $$$************ *
                   *$$$$*    $$$$$          *
                   **************$***********
                   * $$$$$$$$$$$$$          *
                   **$***********************
                   * $$$$$*$$$$$$$$$$$$$$G *
                   * * $$$ *********** * *
                   *    *        ******* * *
                   *       *                *
                   **************************


• http://okajima.air-nifty.com/b/2010/01/post-abc6.html
•         N*M

•             4

•                  O(N * M * 4)

• 50 * 50 * 4 = 10,000
•                     ,



•       :

    •          m

•           dfs bfs

•
• Binary Search

•

•         O(log(n))
•   http://www.gutterbucket.com/general-code/binary-search.html
• Dynamic Programming,   DP

•              ,



•
:


      w         v           N        ,               W
                 .      ,                W      ,
                                 .




• “ALGORITHM NOTE           ”   (http://algorithms.blog55.fc2.com/
  blog-entry-85.html)
•N                       /
     2

• O(2^N)

•N         100   , 2^100 = 10^30
DP

• (N+1) * (W+1)       C

• C[i][w]         w       0
       i
• C[i][w]         2

 • C[i - 1][w -       i   ]+   i

 • C[i - 1][w]
• “ALGORITHM NOTE       ”   (http://algorithms.blog55.fc2.com/
  blog-entry-85.html)
• “ALGORITHM NOTE       ”   (http://algorithms.blog55.fc2.com/
  blog-entry-85.html)
• “ALGORITHM NOTE       ”   (http://algorithms.blog55.fc2.com/
  blog-entry-85.html)
• “ALGORITHM NOTE       ”   (http://algorithms.blog55.fc2.com/
  blog-entry-85.html)
• “ALGORITHM NOTE       ”   (http://algorithms.blog55.fc2.com/
  blog-entry-85.html)
• “ALGORITHM NOTE       ”   (http://algorithms.blog55.fc2.com/
  blog-entry-85.html)
• “ALGORITHM NOTE       ”   (http://algorithms.blog55.fc2.com/
  blog-entry-85.html)
• “ALGORITHM NOTE       ”   (http://algorithms.blog55.fc2.com/
  blog-entry-85.html)
• “ALGORITHM NOTE       ”   (http://algorithms.blog55.fc2.com/
  blog-entry-85.html)
• (N+1) * (W+1)

• O(NW)

•
DP

•        ,



•
DP
•

•

•

•

• etc...
• Greedy Algorithm

•                    ,

    •

•

    •
:


100




• “                            :                           -                ”
      (http://www.itmedia.co.jp/enterprise/articles/1009/04/news002.html)
Greedy

•                   ,



• 15436 = {10000, 5000, 100, 100, 100,
  100, 10, 10, 10, 5, 1}
• {1, 6, 13}

• 18

 • {13, 1, 1, 1, 1, 1}

 • {6, 6, 6}
•

•



•

    •
•

    •

    •

•

    •

    •

• etc...
• TopCoder



    •

•

    • http://topcoder.g.hatena.ne.jp/keyword/Challenge



•          ,
•0

•

•

    •

    •
•                       3



    • @iwiwi, @wata_orz, @kita__masa

•



•



• http://www.amazon.co.jp/
                                 -
       -    /dp/4839931992
•


•
Algorithm Tutorials
• TopCoder



•


•


•


• http://www.topcoder.com/tc?
  module=Static&d1=tutorials
  &d2=alg_index
• chokudai


    • Imagine Cup   3



•


    •
        ,



• http://www.itmedia.co.jp/
  keywords/algorithmer.html
• @kinaba



•              DP



    • http://www.kmonos.net/
      wlog/89.html#_2049080923

    • http://www.kmonos.net/
      wlog/90.html#_1712081024

    • http://www.kmonos.net/
      wlog/91.html#_2024081109
• @kinaba          topcoder-jp


    • http://twitter.com/#/list/kinaba/topcoder-jp

    •


•                  (              )


    • http://topcoder.g.hatena.ne.jp/

    •


    •    60
• Introduction To TopCoder,              TopCoder


    • http://d.hatena.ne.jp/cou929_la/
      20091005/1254725798

•


    • http://d.hatena.ne.jp/cou929_la/
      20100708/1278600922
Programming Contest Hacks

Mais conteúdo relacionado

Mais procurados

Nghien cuu cong_nghe_sx_dich_dam,_bot_ca
Nghien cuu cong_nghe_sx_dich_dam,_bot_caNghien cuu cong_nghe_sx_dich_dam,_bot_ca
Nghien cuu cong_nghe_sx_dich_dam,_bot_ca
saomai491
 
Cameroun - Repertoire des projets prioritaires à besoins de financement
Cameroun - Repertoire des projets prioritaires à besoins de financementCameroun - Repertoire des projets prioritaires à besoins de financement
Cameroun - Repertoire des projets prioritaires à besoins de financement
investincameroon
 
Report of the Export Group on the methodology for the people below the povert...
Report of the Export Group on the methodology for the people below the povert...Report of the Export Group on the methodology for the people below the povert...
Report of the Export Group on the methodology for the people below the povert...
People's Archive of Rural India
 
Moosecon native apps_blackberry_10-optimized
Moosecon native apps_blackberry_10-optimizedMoosecon native apps_blackberry_10-optimized
Moosecon native apps_blackberry_10-optimized
Heinrich Seeger
 
Dialnet el complementodirectopreposicionalenelcastellanodel-918722
Dialnet el complementodirectopreposicionalenelcastellanodel-918722Dialnet el complementodirectopreposicionalenelcastellanodel-918722
Dialnet el complementodirectopreposicionalenelcastellanodel-918722
arpad203
 
التأصيل الطبي للضرورة الطبية
التأصيل الطبي للضرورة الطبيةالتأصيل الطبي للضرورة الطبية
التأصيل الطبي للضرورة الطبية
Dr Ghaiath Hussein
 
Global Change, Species Diversity, and the Future of Marine Ecosystems
Global Change, Species Diversity, and the Future of Marine EcosystemsGlobal Change, Species Diversity, and the Future of Marine Ecosystems
Global Change, Species Diversity, and the Future of Marine Ecosystems
Jarrett Byrnes
 
Dipôles linéaires, régime transitoire
Dipôles linéaires, régime transitoireDipôles linéaires, régime transitoire
Dipôles linéaires, régime transitoire
Achraf Ourti
 
Replica Sets
Replica SetsReplica Sets
Replica Sets
MongoDB
 

Mais procurados (20)

Matrices, Matrix
Matrices, MatrixMatrices, Matrix
Matrices, Matrix
 
Nghien cuu cong_nghe_sx_dich_dam,_bot_ca
Nghien cuu cong_nghe_sx_dich_dam,_bot_caNghien cuu cong_nghe_sx_dich_dam,_bot_ca
Nghien cuu cong_nghe_sx_dich_dam,_bot_ca
 
Hajj or Umra by Shykh Bin Baz
Hajj or Umra by Shykh Bin BazHajj or Umra by Shykh Bin Baz
Hajj or Umra by Shykh Bin Baz
 
Cameroun - Repertoire des projets prioritaires à besoins de financement
Cameroun - Repertoire des projets prioritaires à besoins de financementCameroun - Repertoire des projets prioritaires à besoins de financement
Cameroun - Repertoire des projets prioritaires à besoins de financement
 
Who was william shakespeare ?
Who was william shakespeare ?Who was william shakespeare ?
Who was william shakespeare ?
 
Etransformation de l'éducation avant le bac
Etransformation de l'éducation avant le bacEtransformation de l'éducation avant le bac
Etransformation de l'éducation avant le bac
 
Report of the Export Group on the methodology for the people below the povert...
Report of the Export Group on the methodology for the people below the povert...Report of the Export Group on the methodology for the people below the povert...
Report of the Export Group on the methodology for the people below the povert...
 
Moosecon native apps_blackberry_10-optimized
Moosecon native apps_blackberry_10-optimizedMoosecon native apps_blackberry_10-optimized
Moosecon native apps_blackberry_10-optimized
 
If you can
If you canIf you can
If you can
 
Ecuacionesfuncionales2 1
Ecuacionesfuncionales2 1Ecuacionesfuncionales2 1
Ecuacionesfuncionales2 1
 
Dialnet el complementodirectopreposicionalenelcastellanodel-918722
Dialnet el complementodirectopreposicionalenelcastellanodel-918722Dialnet el complementodirectopreposicionalenelcastellanodel-918722
Dialnet el complementodirectopreposicionalenelcastellanodel-918722
 
التأصيل الطبي للضرورة الطبية
التأصيل الطبي للضرورة الطبيةالتأصيل الطبي للضرورة الطبية
التأصيل الطبي للضرورة الطبية
 
A Little Bit Of Insight 2011
A Little Bit Of Insight 2011A Little Bit Of Insight 2011
A Little Bit Of Insight 2011
 
Tecnicas de sql injection
Tecnicas de sql injectionTecnicas de sql injection
Tecnicas de sql injection
 
Global Change, Species Diversity, and the Future of Marine Ecosystems
Global Change, Species Diversity, and the Future of Marine EcosystemsGlobal Change, Species Diversity, and the Future of Marine Ecosystems
Global Change, Species Diversity, and the Future of Marine Ecosystems
 
Technorati Blogging Stats Preview
Technorati Blogging Stats PreviewTechnorati Blogging Stats Preview
Technorati Blogging Stats Preview
 
Dipôles linéaires, régime transitoire
Dipôles linéaires, régime transitoireDipôles linéaires, régime transitoire
Dipôles linéaires, régime transitoire
 
Nic newman tiger spike mobile publishing masterclass
Nic newman tiger spike mobile publishing masterclassNic newman tiger spike mobile publishing masterclass
Nic newman tiger spike mobile publishing masterclass
 
PR Campaign Proposal
PR Campaign ProposalPR Campaign Proposal
PR Campaign Proposal
 
Replica Sets
Replica SetsReplica Sets
Replica Sets
 

Destaque

Destaque (7)

Object meta-level control on ECMA Script 5
Object meta-level control on ECMA Script 5Object meta-level control on ECMA Script 5
Object meta-level control on ECMA Script 5
 
C language Sem 01
C language Sem 01C language Sem 01
C language Sem 01
 
Survey of the Ontology - オントロジーについての調査
Survey of the Ontology - オントロジーについての調査Survey of the Ontology - オントロジーについての調査
Survey of the Ontology - オントロジーについての調査
 
Introduction To Google App Engine
Introduction To Google App EngineIntroduction To Google App Engine
Introduction To Google App Engine
 
Firefox 学生向けアドオンパック
Firefox 学生向けアドオンパックFirefox 学生向けアドオンパック
Firefox 学生向けアドオンパック
 
Chrome Web Store に登録してみた
Chrome Web Store に登録してみたChrome Web Store に登録してみた
Chrome Web Store に登録してみた
 
C言語演習(2) - OpenCV
C言語演習(2) - OpenCV C言語演習(2) - OpenCV
C言語演習(2) - OpenCV
 

Semelhante a Programming Contest Hacks

Steering Iterative and Incremental Delivery with Jeff Patton
Steering Iterative and Incremental Delivery with Jeff PattonSteering Iterative and Incremental Delivery with Jeff Patton
Steering Iterative and Incremental Delivery with Jeff Patton
UIEpreviews
 

Semelhante a Programming Contest Hacks (20)

Py "Baseball" Data入門〜サービス(と野球)を支えるデータ分析基盤 #monotarotech
Py "Baseball" Data入門〜サービス(と野球)を支えるデータ分析基盤 #monotarotechPy "Baseball" Data入門〜サービス(と野球)を支えるデータ分析基盤 #monotarotech
Py "Baseball" Data入門〜サービス(と野球)を支えるデータ分析基盤 #monotarotech
 
Leadership Guide, 초보팀장을 위한 리더십 가이드
Leadership Guide, 초보팀장을 위한 리더십 가이드Leadership Guide, 초보팀장을 위한 리더십 가이드
Leadership Guide, 초보팀장을 위한 리더십 가이드
 
Tabledown
TabledownTabledown
Tabledown
 
Steering Iterative and Incremental Delivery with Jeff Patton
Steering Iterative and Incremental Delivery with Jeff PattonSteering Iterative and Incremental Delivery with Jeff Patton
Steering Iterative and Incremental Delivery with Jeff Patton
 
Mining the Geo Needles in the Social Haystack
Mining the Geo Needles in the Social HaystackMining the Geo Needles in the Social Haystack
Mining the Geo Needles in the Social Haystack
 
第5回NIPS読み会・関西発表資料
第5回NIPS読み会・関西発表資料第5回NIPS読み会・関西発表資料
第5回NIPS読み会・関西発表資料
 
신뢰성 높은 클라우드 기반 서비스 운영을 위한 Chaos Engineering in Action (윤석찬, AWS 테크에반젤리스트) :: ...
신뢰성 높은 클라우드 기반 서비스 운영을 위한 Chaos Engineering in Action (윤석찬, AWS 테크에반젤리스트) :: ...신뢰성 높은 클라우드 기반 서비스 운영을 위한 Chaos Engineering in Action (윤석찬, AWS 테크에반젤리스트) :: ...
신뢰성 높은 클라우드 기반 서비스 운영을 위한 Chaos Engineering in Action (윤석찬, AWS 테크에반젤리스트) :: ...
 
Onsg10 Intro Termtter
Onsg10 Intro TermtterOnsg10 Intro Termtter
Onsg10 Intro Termtter
 
Casual-Talk #1 青虫の生態について
Casual-Talk #1 青虫の生態についてCasual-Talk #1 青虫の生態について
Casual-Talk #1 青虫の生態について
 
App과 Server의 은밀한 대화
App과 Server의 은밀한 대화App과 Server의 은밀한 대화
App과 Server의 은밀한 대화
 
Czzawk
CzzawkCzzawk
Czzawk
 
Vim - Amazing Editor for DBAs
Vim - Amazing Editor for DBAsVim - Amazing Editor for DBAs
Vim - Amazing Editor for DBAs
 
katagaitai CTF workshop #10 AESに対する相関電力解析
katagaitai CTF workshop #10 AESに対する相関電力解析katagaitai CTF workshop #10 AESに対する相関電力解析
katagaitai CTF workshop #10 AESに対する相関電力解析
 
Happy Go Programming
Happy Go ProgrammingHappy Go Programming
Happy Go Programming
 
Training evaluation workshop ver 00
Training evaluation workshop ver 00Training evaluation workshop ver 00
Training evaluation workshop ver 00
 
[DL輪読会]Tracking Emerges by Colorizing Videos
[DL輪読会]Tracking Emerges by Colorizing Videos[DL輪読会]Tracking Emerges by Colorizing Videos
[DL輪読会]Tracking Emerges by Colorizing Videos
 
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday AdminImprove Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
 
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday AdminImprove Your Salesforce Efficiency: Formulas for the Everyday Admin
Improve Your Salesforce Efficiency: Formulas for the Everyday Admin
 
Game Day in Action for Chaos Engineering - 윤석찬 (AWS 테크에반젤리스트) :: 한국 카오스엔지니어링 밋업
Game Day in Action for Chaos Engineering - 윤석찬 (AWS 테크에반젤리스트) ::  한국 카오스엔지니어링 밋업Game Day in Action for Chaos Engineering - 윤석찬 (AWS 테크에반젤리스트) ::  한국 카오스엔지니어링 밋업
Game Day in Action for Chaos Engineering - 윤석찬 (AWS 테크에반젤리스트) :: 한국 카오스엔지니어링 밋업
 
[表示が崩れる場合ダウンロードしてご覧ください] 2018年のDocker・Moby
[表示が崩れる場合ダウンロードしてご覧ください] 2018年のDocker・Moby[表示が崩れる場合ダウンロードしてご覧ください] 2018年のDocker・Moby
[表示が崩れる場合ダウンロードしてご覧ください] 2018年のDocker・Moby
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Último (20)

Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

Programming Contest Hacks

  • 2. Agenda • • • • • • • • • •
  • 3.
  • 4. @cou929 • ( ) • web • Web technologies • HTML + CSS + JavaScript
  • 5.
  • 6. • • • a.k.a. • • • etc.
  • 7. . n . , 4 . m . . , , . k_1, k_2, ..., k_n , m , ”Yes”, ”No” . 1 <= n <= 50 1 <= m <= 10^8 1 <= k_i <= 10^8 • 1-1
  • 8. • n = 3, m = 10, k = {1, 2, 3, 5} • “Yes” ({1, 1, 3, 5} ) • n = 3, m = 9, k = {1, 3, 5} • “No”
  • 9.
  • 10. • • •
  • 11. • •4 • n 50 • 1 <= n <= 1000 ?
  • 12.
  • 13. TopCoder • ( 2, 3 ) • ! • 1 2 3 • (C++, Java, C#, VB) • • TopCoder • • NASA • http://www.topcoder.com/tc
  • 14. Google Code Jam • • 2 3 • 2 • • Google • ? • http://code.google.com/codejam
  • 15. ACM ICPC • • • • • >< • http://cm.baylor.edu/welcome.icpc
  • 16. • CodeForces • http://codeforces.ru/ • CodeChef • http://www.codechef.com/ • ICFP Programing Contest • http://icfpcontest.org/ • etc.
  • 17. , • ICPC • • • •
  • 18. • PKU Judge Online • http://acm.pku.edu.cn/JudgeOnline/ • Sphere online judge • http://www.spoj.pl/ • AIZU Online Judge • http://rose.u-aizu.ac.jp/onlinejudge/
  • 19.
  • 21. • , , • • • • •
  • 23. “ ” • • , •
  • 24.
  • 26. -> -> ! -> • -> -> ! • •
  • 27. -> -> -> -> -> -> • •
  • 28. • O- • •
  • 29. O- • • O(log n), O(n^3) • • • • 3 -> O(n^3) ! • • .
  • 30. ,n 50 • O(n^4) • 6,250,000
  • 31. 2 1,000,000 100,000,000 1,000,000,000
  • 32. • • • (dfs) • (bfs) • • •
  • 33. : • O(n^4) • n=3 n1 n2 n3 n1 n2 n3 n1 n2 n3 n1 n2 n3 n1 n2 n3 n1 n2 n3 …… ……
  • 34. http://www.itmedia.co.jp/enterprise/articles/1001/16/news001.html
  • 35. , • •
  • 36. : a1, a2, ..., an . , k . 1 <= n <= 20 - 10^8 <= a_i <= 10^8 - 10^8 <= k <= 10^8 n=4 a = {1, 2, 4, 7} k = 13 "Yes" (2 + 4 + 7) • 2-1
  • 37. a_i , / • a_i • O(2^n) •n 20 • 2 ^ 20 = 1,048,576
  • 38.
  • 39. “ : - ” (http:// www.itmedia.co.jp/enterprise/articles/1001/16/news001.html)
  • 40. • dfs • • dfs bfs • • O( * )
  • 41. : • : • http://okajima.air- nifty.com/b/2010/01/ post-abc6.html
  • 42. : , N, M . N = M = 50 • http://okajima.air-nifty.com/b/2010/01/post-abc6.html
  • 43. : ************************** *S* * * * * * * ************* * * * * ************ * * * * ************** *********** * * ** *********************** * * G * * * *********** * * * * ******* * * * * * ************************** • http://okajima.air-nifty.com/b/2010/01/post-abc6.html
  • 44. : ************************** *S* * $$$ * *$* *$$*$ ************* * *$* $$* $$$************ * *$$$$* $$$$$ * **************$*********** * $$$$$$$$$$$$$ * **$*********************** * $$$$$*$$$$$$$$$$$$$$G * * * $$$ *********** * * * * ******* * * * * * ************************** • http://okajima.air-nifty.com/b/2010/01/post-abc6.html
  • 45. N*M • 4 • O(N * M * 4) • 50 * 50 * 4 = 10,000
  • 46.
  • 47. , • : • m • dfs bfs •
  • 49. http://www.gutterbucket.com/general-code/binary-search.html
  • 50. • Dynamic Programming, DP • , •
  • 51. : w v N , W . , W , . • “ALGORITHM NOTE ” (http://algorithms.blog55.fc2.com/ blog-entry-85.html)
  • 52. •N / 2 • O(2^N) •N 100 , 2^100 = 10^30
  • 53. DP • (N+1) * (W+1) C • C[i][w] w 0 i
  • 54. • C[i][w] 2 • C[i - 1][w - i ]+ i • C[i - 1][w]
  • 55. • “ALGORITHM NOTE ” (http://algorithms.blog55.fc2.com/ blog-entry-85.html)
  • 56. • “ALGORITHM NOTE ” (http://algorithms.blog55.fc2.com/ blog-entry-85.html)
  • 57. • “ALGORITHM NOTE ” (http://algorithms.blog55.fc2.com/ blog-entry-85.html)
  • 58. • “ALGORITHM NOTE ” (http://algorithms.blog55.fc2.com/ blog-entry-85.html)
  • 59. • “ALGORITHM NOTE ” (http://algorithms.blog55.fc2.com/ blog-entry-85.html)
  • 60. • “ALGORITHM NOTE ” (http://algorithms.blog55.fc2.com/ blog-entry-85.html)
  • 61. • “ALGORITHM NOTE ” (http://algorithms.blog55.fc2.com/ blog-entry-85.html)
  • 62. • “ALGORITHM NOTE ” (http://algorithms.blog55.fc2.com/ blog-entry-85.html)
  • 63. • “ALGORITHM NOTE ” (http://algorithms.blog55.fc2.com/ blog-entry-85.html)
  • 64. • (N+1) * (W+1) • O(NW) •
  • 65. DP • , •
  • 67. • Greedy Algorithm • , • • •
  • 68. : 100 • “ : - ” (http://www.itmedia.co.jp/enterprise/articles/1009/04/news002.html)
  • 69. Greedy • , • 15436 = {10000, 5000, 100, 100, 100, 100, 10, 10, 10, 5, 1}
  • 70. • {1, 6, 13} • 18 • {13, 1, 1, 1, 1, 1} • {6, 6, 6}
  • 71. • • •
  • 72. • • • • • • etc...
  • 73. • TopCoder • • • http://topcoder.g.hatena.ne.jp/keyword/Challenge • ,
  • 74. •0 • • • •
  • 75.
  • 76. 3 • @iwiwi, @wata_orz, @kita__masa • • • http://www.amazon.co.jp/ - - /dp/4839931992
  • 78. Algorithm Tutorials • TopCoder • • • • http://www.topcoder.com/tc? module=Static&d1=tutorials &d2=alg_index
  • 79. • chokudai • Imagine Cup 3 • • , • http://www.itmedia.co.jp/ keywords/algorithmer.html
  • 80. • @kinaba • DP • http://www.kmonos.net/ wlog/89.html#_2049080923 • http://www.kmonos.net/ wlog/90.html#_1712081024 • http://www.kmonos.net/ wlog/91.html#_2024081109
  • 81. • @kinaba topcoder-jp • http://twitter.com/#/list/kinaba/topcoder-jp • • ( ) • http://topcoder.g.hatena.ne.jp/ • • 60
  • 82. • Introduction To TopCoder, TopCoder • http://d.hatena.ne.jp/cou929_la/ 20091005/1254725798 • • http://d.hatena.ne.jp/cou929_la/ 20100708/1278600922

Notas do Editor