SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

Andere mochten auch (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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, ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

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

Hinweis der Redaktion