Beginner Free Contest 29 - PREFIX

View as PDF

Submit solution

Points: 0.06 (partial)
Time limit: 1.0s
Memory limit: 256M

Problem type
Allowed languages
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch

In case the statement didn't load correctly, you can download the statement here: Statement

Lưu ý: các bạn không nhập, xuất dữ liệu bằng file kể cả khi đề bài có yêu cầu. Đọc, ghi dữ liệu được thực hiện ở stdin và stdout.


Comments

Please read the guidelines before commenting.



  • 0
    _no_love_no_gain_  commented on April 1, 2025, 4:55 a.m.
        if (a.size() > b.size()) {
            cout << "No\n";
            return 0;
        }
        for (int i = 0; i < a.size(); ++i) {
            if (a[i] != b[i]) {
                cout << "No\n";
                return 0;
            }
        }
        cout << "Yes\n";
    

  • 5
    2N1T2K1L  commented on Jan. 13, 2024, 2:43 p.m.

    Ý tưởng

    Đặt vt1 là vị trí đầu của xâu a: int vt1 = a >! Duyệt i từ 0 -> b.size() >! Nếu a[vt1] = b[i] thì vt1++, k thì in ra NO rồi return 0 >1 In ra YES