# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
740031 | mzv | Programiranje (COCI17_programiranje) | C++17 | 3064 ms | 1320 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>
#define ccd ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define endl '\n'
using namespace std;
/* ------------------------ hi lol ------------------------ */
int n,x1,x2,x3,x4;
string s,s1,s2;
int main() {
ccd
cin >> s >> n;
for (int i=1;i<=n;i++) {
cin >> x1 >> x2 >> x3 >> x4;
if ((x2-x1)!=(x4-x3)) {
cout << "NE" << endl;
continue;
}
s1=s.substr(x1-1,x2-x1+1);
s2=s.substr(x3-1,x4-x3+1);
// cout << s1 << " " << s2 << " ";
sort(s1.begin(),s1.end());
sort(s2.begin(),s2.end());
cout << (s1==s2 ? "DA" : "NE") << endl;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |