質問編集履歴

3

書式

2020/01/07 03:24

投稿

krkr
krkr

スコア5

test CHANGED
File without changes
test CHANGED
@@ -44,43 +44,43 @@
44
44
 
45
45
  **ユーザーの情報の読み込み**
46
46
 
47
- no1 = [0,0,1,0]
47
+ no1 = [0,0,1,[1]]
48
-
48
+
49
- no2 = [1,0,0,0]
49
+ no2 = [1,0,0,[2]]
50
-
50
+
51
- no3 = [2,0,1,0]
51
+ no3 = [2,0,1,[3]]
52
-
52
+
53
- no4 = [3,0,0,0]
53
+ no4 = [3,0,0,[4]]
54
-
54
+
55
- no5 = [4,1,0,0]
55
+ no5 = [4,1,0,[5]]
56
-
56
+
57
- no6 = [5,1,0,0]
57
+ no6 = [5,1,0,[6]]
58
-
58
+
59
- no7 = [6,0,0,0]
59
+ no7 = [6,0,0,[7]]
60
-
60
+
61
- no8 = [7,1,0,0]
61
+ no8 = [7,1,0,[8]]
62
-
62
+
63
- no9 = [8,0,0,0]
63
+ no9 = [8,0,0,[9]]
64
-
64
+
65
- no10 = [9,0,1,0]
65
+ no10 = [9,0,1,[10]]
66
-
67
- no11 = [10,0,0,0]
66
+
68
-
69
- no12 = [11,0,0,11]
67
+ no11 = [10,0,0,[11]]
68
+
70
-
69
+ no12 = [11,0,0,[12,11]]
70
+
71
- no13 = [12,0,0,11]
71
+ no13 = [12,0,0,[13,11]]
72
-
72
+
73
- no14 = [13,0,0,0]
73
+ no14 = [13,0,0,[14]]
74
-
74
+
75
- no15 = [14,0,1,0]
75
+ no15 = [14,0,1,[15]]
76
-
76
+
77
- no16 = [15,0,0,3]
77
+ no16 = [15,0,0,[16,3]]
78
-
78
+
79
- no17 = [16,0,0,0]
79
+ no17 = [16,0,0,[17]]
80
-
80
+
81
- no18 = [17,0,0,0]
81
+ no18 = [17,0,0,[18]]
82
-
82
+
83
- no19 = [18,0,0,9]
83
+ no19 = [18,0,0,[19,9]]
84
84
 
85
85
 
86
86
 

2

書式の改善

2020/01/07 03:24

投稿

krkr
krkr

スコア5

test CHANGED
File without changes
test CHANGED
@@ -16,6 +16,12 @@
16
16
 
17
17
 
18
18
 
19
+
20
+
21
+ 現時点では、すべて組み合わせNGという結果になってしまいます。
22
+
23
+
24
+
19
25
  pythonは始めたばかりで勉強している最中なのですが、どのように組み合わせNGを表せばいいのか分からず、困っています。
20
26
 
21
27
  何卒宜しくお願い致します。
@@ -24,6 +30,8 @@
24
30
 
25
31
  ### 該当のソースコード (python)
26
32
 
33
+ ```html
34
+
27
35
  **[(配列としての)ID、制約条件1、制約条件2、組み合わせNG]**
28
36
 
29
37
  import numpy as np
@@ -372,7 +380,15 @@
372
380
 
373
381
  print ('------------------------------')
374
382
 
375
-
383
+ # 組み合わせNGがいないか
384
+
385
+ if Class1[0][3] != Class1[1][3] != Class1[2][3] != Class1[3][3] != Class1[4][3] != Class1[5][3] != Class1[6][3] and Class1[0][2] != Class1[1][2] != Class1[2][2] != Class1[3][2] != Class1[4][2] != Class1[5][2] != Class1[6][2] and Class2[0][3] != Class2[1][3] != Class2[2][3] != Class2[3][3] != Class2[4][3] != Class2[5][3] and Class2[0][2] != Class2[1][2] != Class2[2][2] != Class2[3][2] != Class2[4][2] != Class2[5][2] and Class3[0][3] != Class3[1][3] != Class3[2][3] != Class3[3][3] != Class3[4][3] != Class3[5][3] and Class3[0][2] != Class3[1][2] != Class3[2][2] != Class3[3][2] != Class3[4][2] != Class3[5][2]:
386
+
387
+ print('組み合わせはOK')
388
+
389
+ else:
390
+
391
+ print('組み合わせはNG')
376
392
 
377
393
  print ('------------------------------')
378
394
 
@@ -387,3 +403,5 @@
387
403
  print(Class2)
388
404
 
389
405
  print(Class3)
406
+
407
+ ```

1

書式の改善

2020/01/07 03:18

投稿

krkr
krkr

スコア5

test CHANGED
File without changes
test CHANGED
@@ -16,9 +16,7 @@
16
16
 
17
17
 
18
18
 
19
-
19
+ pythonは始めたばかりで勉強している最中なのですが、どのように組み合わせNGを表せばいいのか分からず、困っています。
20
-
21
-
22
20
 
23
21
  何卒宜しくお願い致します。
24
22