Submission #740031

#TimeUsernameProblemLanguageResultExecution timeMemory
740031mzvProgramiranje (COCI17_programiranje)C++17
40 / 80
3064 ms1320 KiB
#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 timeMemoryGrader output
Fetching results...