# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
89148 | igzi | Programiranje (COCI17_programiranje) | C++17 | 123 ms | 12064 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define maxN 1100005
using namespace std;
string s;
int n,q,a,b,c,d,i,j,x[27][50005];
bool proveri(int a,int b,int c,int d){
for(int i=0;i<27;i++){
if(x[i][b]-x[i][a-1]!=x[i][d]-x[i][c-1]) return false;
}
return true;
}
int main() {
std::ios_base::sync_with_stdio(false);
cin>>s;
n=s.size();
for(i=0;i<n;i++){
for(j=0;j<27;j++){
x[j][i+1]=x[j][i];
}
x[s[i]-'a'][i+1]++;
}
cin>>q;
for(i=0;i<q;i++){
cin>>a>>b>>c>>d;
if(proveri(a,b,c,d)) cout<<"DA"<<endl;
else cout<<"NE"<<endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |