# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
850222 | elotelo966 | Programiranje (COCI17_programiranje) | C++17 | 3093 ms | 544 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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
map<char,int> mp;
int32_t main(){
faster
string s;cin>>s;
int n=s.length();
int q;cin>>q;
while(q--){
mp.clear();
int a,b,c,d;
cin>>a>>b>>c>>d;
a--;b--;c--;d--;
if(b-a!=d-c){
cout<<"NE"<<'\n';
continue;
}
for(int i=a;i<=b;i++){
mp[s[i]]++;
}
bool stop=true;
for(int i=c;i<=d && stop;i++){
if(mp[s[i]]!=0){
mp[s[i]]--;
}
else stop=false;
}
if(stop){
cout<<"DA"<<'\n';
}
else cout<<"NE"<<'\n';
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |