# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
94622 | ahmedie404 | Programiranje (COCI17_programiranje) | C++14 | 4 ms | 1144 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
using namespace std;
string s, s1, s2;
int n;
int a, b, c, d;
int x[27];
int y[27];
int main(){
cin >> s;
cin >> n;
while(n--){
cin >> a >> b >> c >> d;
if(d-c != b-a){
cout << "NE" << endl;
continue;
}
s1 = s.substr(a-1,b-a+1);
s2 = s.substr(c-1,d-c+1);
for(int i=0;i<26;i++) x[i]=0, y[i]=0;
for(int i=0;i<s1.length();i++)
x[(int)s1[i] - 87]++, y[(int)s2[i] - 87]++;
bool f=true;
for(int i=0;i<26;i++)
if(x[i] != y[i]){
f=false;
break;
}
if(f==true)
cout << "DA" << endl;
else
cout << "NE" << endl;
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |