# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
850219 | elotelo966 | Programiranje (COCI17_programiranje) | C++17 | 3053 ms | 1300 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;
#define int long long int
#define OYY 100000005
#define mod 100000007
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mid (start+end)/2
#define lim 100005
int32_t main(){
faster
string s;cin>>s;
int n=s.length();
int q;cin>>q;
while(q--){
int a,b,c,d;
cin>>a>>b>>c>>d;
a--;b--;c--;d--;
if(b-a!=d-c){
cout<<"NE"<<'\n';
}
string deg="",deg1="";
for(int i=a;i<=b;i++){
deg+=s[i];
}
for(int i=c;i<=d;i++){
deg1+=s[i];
}
sort(deg.begin(),deg.end());
sort(deg1.begin(),deg1.end());
if(deg==deg1){
cout<<"DA"<<'\n';
}
else cout<<"NE"<<'\n';
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |