| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 225207 | baoduytran0104 | Programiranje (COCI17_programiranje) | C++14 | 197 ms | 6564 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int a[50005][30], n, t, e, b,c , d;
string s;
int main()
{
cin >> s;
n = s.size();
s = ' ' + s;
for(int i = 1; i <= n; ++i) {
for(int j = 0; j < 26; ++j) {
a[i][j] = a[i - 1][j] + (s[i] - 'a' == j);
}
}
cin >> t;
while(t--) {
cin >> e >> b >> c >> d;
if(b - e != d - c) {
cout << "NE\n";
continue;
}
bool check = 1;
for(int i = 0; i < 26; ++i) {
if (a[b][i] - a[e - 1][i] != a[d][i] - a[c - 1][i]) {
check = 0;
break;
}
}
cout << (check ? "DA" : "NE") << '\n';
}
return 0;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
