SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
Code Jam Japan 2011
練習問題A: 数珠繋ぎ


     @Kshi_Kshi
初期   off




                 E:enable, S:on
                 E:enable, S:off
                 E:disable, S:on
                 E:disable, S:off
           E(Electronic): enable / disable
           S(Switch):     on / off
1回目   on

           off




                       E:enable, S:on
                       E:enable, S:off
                       E:disable, S:on
                       E:disable, S:off
                 E(Electronic): enable / disable
                 S(Switch):     on / off
2回目   off

            on




                       E:enable, S:on
                       E:enable, S:off
                       E:disable, S:on
                       E:disable, S:off
                 E(Electronic): enable / disable
                 S(Switch):     on / off
3回目   on

           on




                off




                       E:enable, S:on
                       E:enable, S:off
                       E:disable, S:on
                       E:disable, S:off
                 E(Electronic): enable / disable
                 S(Switch):     on / off
4回目   off

            off




                  on




                        E:enable, S:on
                        E:enable, S:off
                        E:disable, S:on
                        E:disable, S:off
                  E(Electronic): enable / disable
                  S(Switch):     on / off
5回目   on

           off




                 on




                       E:enable, S:on
                       E:enable, S:off
                       E:disable, S:on
                       E:disable, S:off
                 E(Electronic): enable / disable
                 S(Switch):     on / off
6回目   off

            on




                 on




                       E:enable, S:on
                       E:enable, S:off
                       E:disable, S:on
                       E:disable, S:off
                 E(Electronic): enable / disable
                 S(Switch):     on / off
7回目   on

           on




                on




                off

                       E:enable, S:on
                       E:enable, S:off
                       E:disable, S:on
                       E:disable, S:off
                 E(Electronic): enable / disable
                 S(Switch):     on / off
8回目   off

            off




                  off




                  on

                          E:enable, S:on
                          E:enable, S:off
                          E:disable, S:on
                          E:disable, S:off
                    E(Electronic): enable / disable
                    S(Switch):     on / off
9回目   on

           off




                 off




                 on

                        E:enable, S:on
                        E:enable, S:off
                        E:disable, S:on
                        E:disable, S:off
                  E(Electronic): enable / disable
                  S(Switch):     on / off
10回目   off

             on




                  off




                  on

                         E:enable, S:on
                         E:enable, S:off
                         E:disable, S:on
                         E:disable, S:off
                   E(Electronic): enable / disable
                   S(Switch):     on / off
11回目   on

            on




                 off




                 on

                       E:enable, S:on
                       E:enable, S:off
                       E:disable, S:on
                       E:disable, S:off
                 E(Electronic): enable / disable
                 S(Switch):     on / off
12回目   off

             off




                   on




                   on

                         E:enable, S:on
                         E:enable, S:off
                         E:disable, S:on
                         E:disable, S:off
                   E(Electronic): enable / disable
                   S(Switch):     on / off
13回目   on

            off




                  on




                  on

                         E:enable, S:on
                         E:enable, S:off
                         E:disable, S:on
                         E:disable, S:off
                   E(Electronic): enable / disable
                   S(Switch):     on / off
14回目   off

             on




                  on




                  on

                         E:enable, S:on
                         E:enable, S:off
                         E:disable, S:on
                         E:disable, S:off
                   E(Electronic): enable / disable
                   S(Switch):     on / off
15回目   on

            on




                       on




                       on

                             E:enable, S:on
                             E:enable, S:off
                             E:disable, S:on
                 off
                             E:disable, S:off
                       E(Electronic): enable / disable
                       S(Switch):     on / off
N = 4の場合
初期                              off




        E:enable, S:on
        E:enable, S:off
                                        電球
        E:disable, S:on
        E:disable, S:off
   電             電
   球   L: Off    球    L: On
E(Electronic): enable / disable
S(Switch):     on / off
L(lamp):       on / off
1回目                              on

                                       off




        E:enable, S:on
        E:enable, S:off
                                             電球
        E:disable, S:on
        E:disable, S:off
   電             電
   球   L: Off    球    L: On
E(Electronic): enable / disable
S(Switch):     on / off
L(lamp):       on / off
2回目                              off

                                        on




        E:enable, S:on
        E:enable, S:off
                                         電球
        E:disable, S:on
        E:disable, S:off
   電             電
   球   L: Off    球    L: On
E(Electronic): enable / disable
S(Switch):     on / off
L(lamp):       on / off
3回目                              on

                                       on




                                             off



        E:enable, S:on
        E:enable, S:off
                                        電球
        E:disable, S:on
        E:disable, S:off
   電             電
   球   L: Off    球    L: On
E(Electronic): enable / disable
S(Switch):     on / off
L(lamp):       on / off
4回目                              off

                                        off




                                               on



        E:enable, S:on
        E:enable, S:off
                                          電球
        E:disable, S:on
        E:disable, S:off
   電             電
   球   L: Off    球    L: On
E(Electronic): enable / disable
S(Switch):     on / off
L(lamp):       on / off
5回目                              on

                                       off




                                              on



        E:enable, S:on
        E:enable, S:off
                                         電球
        E:disable, S:on
        E:disable, S:off
   電             電
   球   L: Off    球    L: On
E(Electronic): enable / disable
S(Switch):     on / off
L(lamp):       on / off
6回目                              off

                                        on




                                              on



        E:enable, S:on
        E:enable, S:off
                                         電球
        E:disable, S:on
        E:disable, S:off
   電             電
   球   L: Off    球    L: On
E(Electronic): enable / disable
S(Switch):     on / off
L(lamp):       on / off
7回目                              on

                                       on




                                             on



        E:enable, S:on
        E:enable, S:off
                                        電球
        E:disable, S:on
        E:disable, S:off
   電             電
   球   L: Off    球    L: On
E(Electronic): enable / disable
S(Switch):     on / off
L(lamp):       on / off
8回目(=初期)                        off

    周期は8.




        E:enable, S:on
        E:enable, S:off
                                        電球
        E:disable, S:on
        E:disable, S:off
   電             電
   球   L: Off    球    L: On
E(Electronic): enable / disable
S(Switch):     on / off
L(lamp):       on / off

Mais conteúdo relacionado

Destaque

Issues for people living in squatter settlements in led cs
Issues for people living in squatter settlements in led csIssues for people living in squatter settlements in led cs
Issues for people living in squatter settlements in led cs
tudorgeog
 
What are the issues for people living in squatter settlements in poorer parts...
What are the issues for people living in squatter settlements in poorer parts...What are the issues for people living in squatter settlements in poorer parts...
What are the issues for people living in squatter settlements in poorer parts...
anwonka
 
Urban problems
Urban problemsUrban problems
Urban problems
afifibs
 
Introduction to town planning
Introduction to town planningIntroduction to town planning
Introduction to town planning
ctlachu
 

Destaque (7)

Skyline queries
Skyline queriesSkyline queries
Skyline queries
 
Issues for people living in squatter settlements in led cs
Issues for people living in squatter settlements in led csIssues for people living in squatter settlements in led cs
Issues for people living in squatter settlements in led cs
 
What are the issues for people living in squatter settlements in poorer parts...
What are the issues for people living in squatter settlements in poorer parts...What are the issues for people living in squatter settlements in poorer parts...
What are the issues for people living in squatter settlements in poorer parts...
 
Structural Geology
Structural Geology Structural Geology
Structural Geology
 
Urban problems
Urban problemsUrban problems
Urban problems
 
Introduction to town planning
Introduction to town planningIntroduction to town planning
Introduction to town planning
 
Engineering Geology (Civil Engineering Applications)
Engineering Geology (Civil Engineering Applications)Engineering Geology (Civil Engineering Applications)
Engineering Geology (Civil Engineering Applications)
 

Mais de Kenji Koshikawa (8)

20130120
2013012020130120
20130120
 
Jaws2012 koshikawa
Jaws2012 koshikawaJaws2012 koshikawa
Jaws2012 koshikawa
 
[International Asian LOD Challenge Day 2012]LOD generation of Social and Mass...
[International Asian LOD Challenge Day 2012]LOD generation of Social and Mass...[International Asian LOD Challenge Day 2012]LOD generation of Social and Mass...
[International Asian LOD Challenge Day 2012]LOD generation of Social and Mass...
 
[JAWS2012]CRFを用いた メディア情報の抽出とLinked Data化 ~ ソーシャルメディアとマスメディアの比較事例 ~
[JAWS2012]CRFを用いた メディア情報の抽出とLinked Data化 ~ ソーシャルメディアとマスメディアの比較事例 ~[JAWS2012]CRFを用いた メディア情報の抽出とLinked Data化 ~ ソーシャルメディアとマスメディアの比較事例 ~
[JAWS2012]CRFを用いた メディア情報の抽出とLinked Data化 ~ ソーシャルメディアとマスメディアの比較事例 ~
 
Sna book chapter_5
Sna book chapter_5Sna book chapter_5
Sna book chapter_5
 
集合知プログラミング 第6章 ドキュメントとフィルタリング~draft
集合知プログラミング 第6章 ドキュメントとフィルタリング~draft集合知プログラミング 第6章 ドキュメントとフィルタリング~draft
集合知プログラミング 第6章 ドキュメントとフィルタリング~draft
 
Google code jam japan2011 練習問題a
Google code jam japan2011 練習問題aGoogle code jam japan2011 練習問題a
Google code jam japan2011 練習問題a
 
[WWW Conference 2011]Information Credibility on Twitter
[WWW Conference 2011]Information Credibility on Twitter[WWW Conference 2011]Information Credibility on Twitter
[WWW Conference 2011]Information Credibility on Twitter
 

Último

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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
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
 

Último (20)

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
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
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
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
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
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
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...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
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
 
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)
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 

Code jam japan2011 練習問題A

  • 1. Code Jam Japan 2011 練習問題A: 数珠繋ぎ @Kshi_Kshi
  • 2. 初期 off E:enable, S:on E:enable, S:off E:disable, S:on E:disable, S:off E(Electronic): enable / disable S(Switch): on / off
  • 3. 1回目 on off E:enable, S:on E:enable, S:off E:disable, S:on E:disable, S:off E(Electronic): enable / disable S(Switch): on / off
  • 4. 2回目 off on E:enable, S:on E:enable, S:off E:disable, S:on E:disable, S:off E(Electronic): enable / disable S(Switch): on / off
  • 5. 3回目 on on off E:enable, S:on E:enable, S:off E:disable, S:on E:disable, S:off E(Electronic): enable / disable S(Switch): on / off
  • 6. 4回目 off off on E:enable, S:on E:enable, S:off E:disable, S:on E:disable, S:off E(Electronic): enable / disable S(Switch): on / off
  • 7. 5回目 on off on E:enable, S:on E:enable, S:off E:disable, S:on E:disable, S:off E(Electronic): enable / disable S(Switch): on / off
  • 8. 6回目 off on on E:enable, S:on E:enable, S:off E:disable, S:on E:disable, S:off E(Electronic): enable / disable S(Switch): on / off
  • 9. 7回目 on on on off E:enable, S:on E:enable, S:off E:disable, S:on E:disable, S:off E(Electronic): enable / disable S(Switch): on / off
  • 10. 8回目 off off off on E:enable, S:on E:enable, S:off E:disable, S:on E:disable, S:off E(Electronic): enable / disable S(Switch): on / off
  • 11. 9回目 on off off on E:enable, S:on E:enable, S:off E:disable, S:on E:disable, S:off E(Electronic): enable / disable S(Switch): on / off
  • 12. 10回目 off on off on E:enable, S:on E:enable, S:off E:disable, S:on E:disable, S:off E(Electronic): enable / disable S(Switch): on / off
  • 13. 11回目 on on off on E:enable, S:on E:enable, S:off E:disable, S:on E:disable, S:off E(Electronic): enable / disable S(Switch): on / off
  • 14. 12回目 off off on on E:enable, S:on E:enable, S:off E:disable, S:on E:disable, S:off E(Electronic): enable / disable S(Switch): on / off
  • 15. 13回目 on off on on E:enable, S:on E:enable, S:off E:disable, S:on E:disable, S:off E(Electronic): enable / disable S(Switch): on / off
  • 16. 14回目 off on on on E:enable, S:on E:enable, S:off E:disable, S:on E:disable, S:off E(Electronic): enable / disable S(Switch): on / off
  • 17. 15回目 on on on on E:enable, S:on E:enable, S:off E:disable, S:on off E:disable, S:off E(Electronic): enable / disable S(Switch): on / off
  • 19. 初期 off E:enable, S:on E:enable, S:off 電球 E:disable, S:on E:disable, S:off 電 電 球 L: Off 球 L: On E(Electronic): enable / disable S(Switch): on / off L(lamp): on / off
  • 20. 1回目 on off E:enable, S:on E:enable, S:off 電球 E:disable, S:on E:disable, S:off 電 電 球 L: Off 球 L: On E(Electronic): enable / disable S(Switch): on / off L(lamp): on / off
  • 21. 2回目 off on E:enable, S:on E:enable, S:off 電球 E:disable, S:on E:disable, S:off 電 電 球 L: Off 球 L: On E(Electronic): enable / disable S(Switch): on / off L(lamp): on / off
  • 22. 3回目 on on off E:enable, S:on E:enable, S:off 電球 E:disable, S:on E:disable, S:off 電 電 球 L: Off 球 L: On E(Electronic): enable / disable S(Switch): on / off L(lamp): on / off
  • 23. 4回目 off off on E:enable, S:on E:enable, S:off 電球 E:disable, S:on E:disable, S:off 電 電 球 L: Off 球 L: On E(Electronic): enable / disable S(Switch): on / off L(lamp): on / off
  • 24. 5回目 on off on E:enable, S:on E:enable, S:off 電球 E:disable, S:on E:disable, S:off 電 電 球 L: Off 球 L: On E(Electronic): enable / disable S(Switch): on / off L(lamp): on / off
  • 25. 6回目 off on on E:enable, S:on E:enable, S:off 電球 E:disable, S:on E:disable, S:off 電 電 球 L: Off 球 L: On E(Electronic): enable / disable S(Switch): on / off L(lamp): on / off
  • 26. 7回目 on on on E:enable, S:on E:enable, S:off 電球 E:disable, S:on E:disable, S:off 電 電 球 L: Off 球 L: On E(Electronic): enable / disable S(Switch): on / off L(lamp): on / off
  • 27. 8回目(=初期) off 周期は8. E:enable, S:on E:enable, S:off 電球 E:disable, S:on E:disable, S:off 電 電 球 L: Off 球 L: On E(Electronic): enable / disable S(Switch): on / off L(lamp): on / off