[12月生日]“获得喷气机”解决方案和评论

[12月生日]“获得喷气机”解决方案和评论

[生日问题12月]喷气式飞机被提出

对于12月生日的人来说,这个问题是一个编码问题。

让我们看看下面的问题,答案和解释。

问题

你有一架飞机作为生日礼物。

您可以获得的喷气式飞机是内置式喷气式飞机。 通过组合机身,右翼和左翼部件,可以制造一个喷射器。

每个部分用整数表示,机身值为0,右翼为1,左翼为2。

编写一个程序,计算可以构建的喷气机数量,组合零件。

案件

以下是输入的示例。

数字从标准输入传递为换行符分隔符。

0
1
0
2
1
0
2
1

以下是输出的示例。 由于最多可以制作两对“0,1,2”,因此它变为“2”。

将答案输出到标准输出,如下所示。

2

输入和输出

输入1和输出1

//输入1
0
1
0
2
1
0
2
1

//输出1
2

输入2和输出2

//输入2
0
0
1
0
2
2
2
1
0
0
2
1
2
2
0
0
2
2
1
1
2
0
2
2
0
0
2
2
1
1
1
0
2
2
0
1
0
1
1
0
1
0
2
2
1
2
1
1
0
2
0
1
1
0
1
0
0
1
1
1
0
2
1
1
1
2
1
2
1
0
1
0
1
0
1
1
0
1
2
1
0
2
1
1
0
2
1
0
2
0
1
1
1
0
1
1
0
0
1
1
0
0
1
2
1
1
0
0
2
2
0
1
1
0
1
0
0
1
0
0
1
0
1
2
1
2
2
2
1
0
2
0
1
1
0
0
0
0
0
1
0
0
0
2
1
2
2
0
2
2
0
0
0
2
0
2
0
2
2
0
2
2
2
1
2
2
2
2
0
2
2
1
0
2
0
2
0
2
0
0
2
0
2
2
2
1
0
1
0
2
0
0
2
2
1
0
1
2
1
1
2
2
2
2
2
2
2
0
1
0
1
0
2
0
2
2
1
1
1
0
1
0
1
1
0
2
1
1
1
2
1
1
0
0
0
1
0
0
1
0
1
2
0
0
1
1
1
0
1
2
2
0
0
0
0
1
1
1
1
1
1
2
2
2
1
2
1
0
1
1
2
2
2
1
0
0
0
1
2
2
1
1
0
2
2
0
1
2
2
2
2
2
2
2
1
0
2
1
2
0
2
0
2
2
0
2
2
2
0
0
2
0
2
0
1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