SlideShare a Scribd company logo
1 of 27
Download to read 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

More Related Content

Viewers also liked

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
 

Viewers also liked (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)
 

More from 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
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

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
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

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