Project: Optimal Circuit Synthesis with SAT · Seven-Segment Display

Lesson 2

Nikolai Chukhin · Alexander S. Kulikov

Programming problem. Construct one shared circuit for a decimal seven-segment display.

  • Input format.  The only line contains the maximum number of gates \(k\).

  • Output format.  First print the number of gates \(m\le k\). Then print \(m\) gate lines in the same format as in the previous task. There are four inputs, numbered \(0,1,2,3\), with the most significant bit first. Finally, print seven source indices for segments \(a,b,c,d,e,f,g\). The checker tests inputs 0 through 9; the remaining six inputs are don't-cares.

10 points
Public samples
Public sample 1
Input
76
Expected output
76
0 0 1100
1 1 1100
2 2 1100
3 3 1100
4 5 0001
8 6 0001
9 7 0001
4 5 0001
11 6 0001
12 3 0001
4 5 0001
14 2 0001
15 7 0001
4 5 0001
17 2 0001
18 3 0001
4 1 0001
20 6 0001
21 7 0001
4 1 0001
23 6 0001
24 3 0001
4 1 0001
26 2 0001
27 7 0001
4 1 0001
29 2 0001
30 3 0001
0 5 0001
32 6 0001
33 7 0001
0 5 0001
35 6 0001
36 3 0001
10 16 0111
38 19 0111
39 25 0111
40 28 0111
41 31 0111
42 34 0111
43 37 0111
10 13 0111
45 16 0111
46 19 0111
47 22 0111
48 31 0111
49 34 0111
50 37 0111
10 13 0111
52 19 0111
53 22 0111
54 25 0111
55 28 0111
56 31 0111
57 34 0111
58 37 0111
10 16 0111
60 19 0111
61 25 0111
62 28 0111
63 34 0111
64 37 0111
10 16 0111
66 28 0111
67 34 0111
10 22 0111
69 25 0111
70 28 0111
71 34 0111
72 37 0111
16 19 0111
74 22 0111
75 25 0111
76 28 0111
77 34 0111
78 37 0111
44 51 59 65 68 73 79