Submission #659993

#TimeUsernameProblemLanguageResultExecution timeMemory
659993ajthelegendcoderProgramiranje (COCI17_programiranje)C++17
40 / 80
3083 ms856 KiB
#include <bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; int q; cin >> q; while(q--){ int a,b,c,d; cin >> a >> b >> c >> d; a -= 1; b -= 1; c -= 1; d -= 1; string x = s.substr(a,b-a+1); string y = s.substr(c,d-c+1); sort(x.begin(), x.end()); sort(y.begin(), y.end()); if(x == y) cout << "DA" << endl; else cout << "NE" << endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...