UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#213989#2739. 阿空的核聚变Running_a_wayCompile Error//C++649b2024-11-14 21:39:582024-11-14 23:08:20

answer

#include <iostream>
#include <cstdio>
#include <map>
using namespace std;

const int N = 5e5 + 10;
string s;
int n, m;
map<int, string> mp;

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> s;
    n = s.size(); s = ' ' + s;
    string p;
    cin >> m;
    while(m--) {
        int l, r; cin >> l >> r;
        p = "";
        for (int i = l; i <= r; i++) {
            char ch = s[i];
            while(p.size() && p.back() == ch) p.pop_back(), ch++;
            if(ch <= 'z') p.push_back(ch);
        }
        if(p.size()) cout << "No\n";
        else cout << "Yes\n";
    }
    return 0;
}

详细

answer.code: In function 'int main()':
answer.code:22:33: error: 'std::string' has no member named 'back'
             while(p.size() && p.back() == ch) p.pop_back(), ch++;\x0d
                                 ^
answer.code:22:49: error: 'std::string' has no member named 'pop_back'
             while(p.size() && p.back() == ch) p.pop_back(), ch++;\x0d
                                                 ^