Submission #654973

#TimeUsernameProblemLanguageResultExecution timeMemory
654973berrProgramiranje (COCI17_programiranje)C++17
80 / 80
38 ms10724 KiB
#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"; } }

Compilation message (stderr)

programiranje.cpp: In function 'int32_t main()':
programiranje.cpp:12:19: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |     for(int i=0; i<s.size(); i++)
      |                  ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...