#include <bits/stdc++.h>
#define fio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long
using namespace std ;
vector <int> v (50005) ;
int32_t main ()
{
fio
string s ;
cin >> s ;
int q ;
cin >> q ;
while ( q-- )
{
int a , b , c , d ;
cin >> a >> b >> c >> d ;
a-- ; b-- ; c-- ; d-- ;
bool jean = 1 ;
while ( a <= b )
{
v[s[a]-'a']++ ;
a++ ;
}
while ( c <= d )
{
if ( v[s[c]-'a'] > 0 ) v[s[c]-'a']-- ;
else
{
jean = 0 ;
break ;
}
c++ ;
}
if ( jean ) cout << "DA\n" ;
else cout << "NE\n" ;
v.clear() ;
}
return 0 ;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
716 KB |
Output isn't correct |
2 |
Incorrect |
5 ms |
712 KB |
Output isn't correct |
3 |
Incorrect |
6 ms |
588 KB |
Output isn't correct |
4 |
Incorrect |
5 ms |
716 KB |
Output isn't correct |
5 |
Incorrect |
6 ms |
716 KB |
Output isn't correct |
6 |
Execution timed out |
3069 ms |
1076 KB |
Time limit exceeded |
7 |
Execution timed out |
3099 ms |
1084 KB |
Time limit exceeded |
8 |
Execution timed out |
3098 ms |
1080 KB |
Time limit exceeded |
9 |
Execution timed out |
3068 ms |
1076 KB |
Time limit exceeded |
10 |
Execution timed out |
3058 ms |
1088 KB |
Time limit exceeded |