- Category:
- Windows Develop
- Tags:
-
- File Size:
- 2kb
- Update:
- 2018-12-11
- Downloads:
- 1 Times
- Uploaded by:
- 小小螃蟹
Description: 1. Each necklace consists of N randomly arranged red, white and blue beads (3<=N<=350).
2. Participants cut and straighten the necklace somewhere; then collect the same color beads from one end to the other until they meet a different color bead; and then do the same thing from the other end. The color of beads collected at one end can be different from that collected at the other end. )
3. When encountering white beads, they can be viewed as either blue beads or red beads, depending on the needs of collecting beads.
4. Find a place to cut off the necklace and collect as many pearls of the same color as possible. The winner can get a pearl necklace free of charge.
Now please help me to write a program to calculate how many beads can be collected from a necklace. The following examples show two necklaces when N = 29:
To Search:
File list (Check if you may need any files):
Filename | Size | Date |
---|
5.定情礼物.cpp | 1314 | 2018-10-08
|
6.良乡足球场.cpp | 958 | 2018-10-09
|
7.郭老师爱合并果子.cpp | 2022 | 2018-10-14 |