#include <bits/stdc++.h>
#define fio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long
using namespace std ;
map <char,int> mp ;
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 )
{
mp[s[a]]++ ;
a++ ;
}
while ( c < d )
{
if ( mp[s[c]] ) mp[s[c]]-- ;
else
{
jean = 0 ;
break ;
}
c++ ;
}
if ( jean ) cout << "DA\n" ;
else cout << "NE\n" ;
mp.clear() ;
}
return 0 ;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
39 ms |
332 KB |
Output isn't correct |
2 |
Incorrect |
35 ms |
328 KB |
Output isn't correct |
3 |
Incorrect |
36 ms |
204 KB |
Output isn't correct |
4 |
Incorrect |
36 ms |
328 KB |
Output isn't correct |
5 |
Incorrect |
37 ms |
332 KB |
Output isn't correct |
6 |
Execution timed out |
3091 ms |
636 KB |
Time limit exceeded |
7 |
Execution timed out |
3078 ms |
640 KB |
Time limit exceeded |
8 |
Execution timed out |
3062 ms |
640 KB |
Time limit exceeded |
9 |
Execution timed out |
3047 ms |
636 KB |
Time limit exceeded |
10 |
Execution timed out |
3072 ms |
652 KB |
Time limit exceeded |