Gildas Chabot лет назад: 8
Родитель
Сommit
55e49040ed
2 измененных файлов с 71 добавлено и 0 удалено
  1. 37 0
      2017.1-RoundOne/a.PieProgress.py
  2. 34 0
      2017.1-RoundOne/pie_progress_example_input.txt

+ 37 - 0
2017.1-RoundOne/a.PieProgress.py

@@ -0,0 +1,37 @@
1
+import numpy as np
2
+
3
+def choose(day, price, pies, S):
4
+    pies.append()
5
+    for i in len(S[day]):
6
+        if S[day][i] == price:
7
+            del S[day][i]
8
+            return
9
+
10
+def findBest(pies, S):
11
+
12
+def solve(N, M, S):
13
+    print("N={0}, M={1}".format(N, M))
14
+    print(S)
15
+
16
+    pies = []
17
+    # First day: chose the cheapest
18
+    pies[0] = min(S[0])
19
+    
20
+
21
+    # Next days
22
+    for i in range(1, M):
23
+        day, price = findBest(pies, S)
24
+        
25
+
26
+    return 'white'
27
+
28
+if __name__ == "__main__":
29
+    import fileinput
30
+    f = fileinput.input()
31
+
32
+    T = int(f.readline())
33
+    for case in range(1, T+1):
34
+        N, M = [int(i) for i in f.readline().split()]
35
+        S = [[int(i) for i in f.readline().split()] for x in range(N)]
36
+        solution = solve(N, M, S)
37
+        print("Case #{0}: {1}".format(case, solution))

+ 34 - 0
2017.1-RoundOne/pie_progress_example_input.txt

@@ -0,0 +1,34 @@
1
+5
2
+3 2
3
+1 1
4
+100 100
5
+10000 10000
6
+5 1
7
+1
8
+2
9
+3
10
+4
11
+5
12
+5 5
13
+1 2 3 4 5
14
+2 3 4 5 1
15
+3 4 5 1 2
16
+4 5 1 2 3
17
+5 1 2 3 4
18
+5 5
19
+1 1 1 1 1
20
+2 2 2 2 2
21
+3 3 3 3 3
22
+4 4 4 4 4
23
+5 5 5 5 5
24
+10 4
25
+7 15 12 6
26
+15 3 19 18
27
+10 9 10 14
28
+12 14 8 8
29
+5 3 5 11
30
+9 14 19 11
31
+12 6 20 9
32
+18 13 12 15
33
+14 14 10 20
34
+11 19 12 11