#P1664. 每日打卡心情好
每日打卡心情好
Description
Luogu’s check-in system is similar to other websites: the more consecutive days you check in, the more rewards you get each time, and the consecutive days increase by one. However, on other websites, if you miss a day, your consecutive days reset to zero. Unlike other websites, Luogu is more user-friendly: if you miss multiple days, your consecutive days only decrease, and the fewer the missed days, the fewer days are deducted. The rule is to reduce by days, where is the number of consecutively missed days. The streak is settled at the next check-in, and the streak will not go below . In other words, if you check in every other day, the streak will remain unchanged.
When the streak reaches the following lengths, different activity point rewards are given:
day: reward (A journey of a thousand miles begins with a single step).
days: reward (You’ve kept it up for days, keep going!).
days: reward (The weekly cycle).
days: reward (From full moon to crescent, habits are formed).
days: reward (You’ve persisted for four months!).
days: reward (You kept it up for all four seasons! Not easy!).
Xiao A registered a Luogu account days ago. Although he vowed to check in every day, he found it hard to keep. Now that we know his check-in record for days, Xiao A wants to know how many activity points he can obtain from check-ins in days.
Input Format
The first line contains an integer .
The next lines each contain an integer or , indicating whether he checked in on that day.
Output Format
Output a single integer, the total activity points obtained.
12
1
1
1
1
1
0
0
0
1
0
1
1
12
Hint
Day : // Start checking in! Gain activity point, total , streak day.
Day : // Gain activity point, total , streak days.
Day : // Gain activity points, total , streak days.
Day : // Gain activity points, total , streak days.
Day : // Gain activity points, total , streak days.
Day : // Going to Mars, no internet, had to miss a check-in.
Day : .
Day : .
Day : // I’m back, but unfortunately the streak became day... TQT... Gain activity point, total , streak days.
Day : // Ah, too many things to do, forgot it.
Day : // Streak became day. Gain activity point, total , streak days.
Day : // Gain activity points, total , streak days.
Xiao A: How about making an automatic check-in machine?
kkksc03: That does not comply with Luogu’s rules!
Constraints: .
Translated by ChatGPT 5
京公网安备 11011102002149号