Editorial for SPECPAIR - Số đặc biệt
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Tóm tắt đề bài
Cho một dãy số nguyên dương
Lời giải
Trước hết, ta nhận xét rằng số lượng số đặc biệt không lớn (có tổng cộng 55 số đặc biệt có giá trị không vượt quá 2 ×
Khởi tạo mảng
- Duyệt qua từng số đặc biệt
, cộng thêm giá trị vào đáp án. - Tăng giá trị
thêm 1.
Độ phức tạp:
Comments