# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
224479 | baoduytran0104 | Programiranje (COCI17_programiranje) | C++14 | 3098 ms | 1192 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int q, a, b, c, d, k, m[100], n, t;
string s, x, y;
int main()
{
cin >> s;
k = s.length();
s = ' ' + s;
cin >> q;
while(q--) {
t = 0;
cin >> a >> b >> c >> d;
if (b -a != d - c) {
cout << "NE" << '\n';
continue;
}
x = s.substr(a, b - a + 1);
y = s.substr(c, d - c + 1);
sort(x.begin(), x.end());
sort(y.begin(), y.end());
if(x == y) cout << "DA\n";
else cout << "NE\n";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |