fork download
  1.  
  2. # a-z list []
  3. import sys
  4. sys.modules[__name__].__dict__.update(dict([(chr(x), []) for x in range(ord('a'), ord('z') + 1)]))
  5.  
  6.  
  7.  
  8. from collections import OrderedDict
  9.  
  10. # 倉庫=Warehouse
  11.  
  12. #Brown=褐色,Light_blue=水色,鉄道=Railway,紫色=Purple,
  13. #橙色=Orange,赤=Red,黄色=Yellow,緑=Green,深青色=Darkblue
  14. Warehouse={'Brown':[6,5],'Brown1':[6,5],
  15. 'Light_blue':[10,5],'Light_blue1':[10,5],'Light_blue2':[12,5],
  16. 'Railway':[20],'Railway1':[20],'Railway2':[20],'Railway3':[20,],
  17. 'Purple':[14,10],'Purple1':[14,10],'Purple2':[16,10],
  18. 'Orange':[18,10],'Orange1':[18,10],'Orange2':[20,10],
  19. 'Red':[22,15],'Red1':[22,15],'Red2':[24,15],
  20. 'Yellow':[26,15],'Yellow1':[26,15],'Yellow2':[25,15],
  21. 'Green':[30,20],'Green1':[30,20],'Green':[32,20],
  22. 'Darkblue':[35,20],'Darkblue':[40,20],
  23. 'GO':[20]
  24. }
  25.  
  26.  
  27. #Warehouse02=OrderedDict(Warehouse)
  28. #print(Warehouse),print(Warehouse)
  29. #print(Warehouse02),print(Warehouse02)
  30. #[print(i,Warehouse02[i],end='') for i in Warehouse02]
  31. #print(len(lst),lst)
  32. #[print(i,200/lst[i][0],end='') for i in lst]
  33. #print()
  34.  
  35.  
  36.  
  37. [r.append(200)]
  38. # lst 後で使う
  39. lst =[[3*y + x for x in range(1,4)] for y in range(3)]
  40. # lst2 MAP
  41. lst2=[[0 for i in range(5)] for i2 in range(5)]
  42.  
  43. # lst3 所有アイテム
  44. lst3=[2,5,8,4]
  45. # lst4 表示用アイテム
  46. lst4=['森','海','山','道']
  47.  
  48. def Sample02():
  49. # 資金の表示
  50. print('資金',r)
  51. # lst3 and lst4を表示
  52. print(list(zip(lst3,lst4)))
  53. # MAPを描画
  54. [print(i) for i in lst2]
  55. # 改行
  56. print()
  57.  
  58. # Le2アイテム用 倉庫
  59. lst5=[0 for _ in range(4)]
  60. # Le2アイテム 表示用
  61. lst6=['森林','航海','山脈','交通']
  62.  
  63. # テスト
  64. lst2[0][0]='森'
  65.  
  66.  
  67. def Sample01():
  68. # MAP上アイテムのカウント それぞれ
  69. [l.append(i.count('森')) for i in lst2]
  70. l2=[i.count('海') for i in lst2]
  71. l3=[i.count('山') for i in lst2]
  72. l4=[i.count('道') for i in lst2]
  73.  
  74. # カウントしたアイテム総数を表示
  75. print('(森)の合計',sum(l), "\t\t",'森が5個で森林1')
  76. print('(海)の合計',sum(l2),"\t\t",'海が5個で森林1')
  77. print('(山)の合計',sum(l3),"\t\t",'山が5個で森林1')
  78. print('(道)の合計',sum(l4),"\t\t",'道が5個で森林1')
  79. # le2アイテムと所有数を表示
  80. print(list(zip(lst5,lst6)))
  81.  
  82.  
  83. Sample02()
  84. Sample01()
  85.  
  86.  
  87.  
  88.  
  89.  
  90. """
  91. #メイン処理
  92. for i in range(3):
  93. xx=list(map(int,input().split()))
  94. try:
  95. if xx[2]==0:
  96. if lst3[0]>=1:
  97. lst3[0]-=1
  98. lst2[xx[0]][xx[1]]='森'
  99. else:
  100. pass
  101. elif xx[2]==1:
  102. if lst3[1]>=1:
  103. lst3[1]-=1
  104. lst2[xx[0]][xx[1]]='海'
  105. else:
  106. pass
  107. elif xx[2]==2:
  108. if lst3[2]>=1:
  109. lst3[2]-=1
  110. lst2[xx[0]][xx[1]]='山'
  111. else:
  112. pass
  113. elif xx[2]==3:
  114. if lst3[3]>=1:
  115. lst3[3]-=1
  116. lst2[xx[0]][xx[1]]='道'
  117. else:
  118. pass
  119.  
  120. Sample02()
  121.  
  122. Sample01()
  123.  
  124. except ValueError:
  125. pass
  126.  
  127. """
  128.  
Success #stdin #stdout 0.04s 9232KB
stdin
Standard input is empty
stdout
資金 [200]
[(2, '森'), (5, '海'), (8, '山'), (4, '道')]
['森', 0, 0, 0, 0]
[0, 0, 0, 0, 0]
[0, 0, 0, 0, 0]
[0, 0, 0, 0, 0]
[0, 0, 0, 0, 0]

(森)の合計 1 		 森が5個で森林1
(海)の合計 0 		 海が5個で森林1
(山)の合計 0 		 山が5個で森林1
(道)の合計 0 		 道が5個で森林1
[(0, '森林'), (0, '航海'), (0, '山脈'), (0, '交通')]