# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
654973 | berr | Programiranje (COCI17_programiranje) | C++17 | 38 ms | 10724 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
int e[50005][26];
int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
string s; cin>>s;
for(int i=0; i<s.size(); i++)
{
for(int l=0; l<26&&i>0; l++)
{
e[i][l]=e[i-1][l];
}
e[i][s[i]-'a']++;
}
int q;cin>>q;
while(q--)
{
int a, b, c, d; cin>>a>>b>>c>>d;
a--; b--; c--; d--;
vector<int> f(26), g(26);
for(int i=0; i<26; i++)
{
f[i]=e[b][i];
if(a!=0) f[i]-=e[a-1][i];
g[i]=e[d][i];
if(c!=0) g[i]-=e[c-1][i];
}
if(f==g) cout<<"DA\n";
else cout<<"NE\n";
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |