Submission #1086494

#TimeUsernameProblemLanguageResultExecution timeMemory
1086494toast12Programiranje (COCI17_programiranje)C++14
40 / 80
3074 ms1080 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    string s;
    cin >> s;
    int q;
    cin >> q;
    while (q--) {
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        string x = s.substr(a-1, b-a+1);
        string y = s.substr(c-1, d-c+1);
        sort(x.begin(), x.end());
        sort(y.begin(), y.end());
        if (x == y) cout << "DA\n";
        else cout << "NE\n";
    }
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...