제출 #1086494

#제출 시각아이디문제언어결과실행 시간메모리
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;
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…