Submission #624796

#TimeUsernameProblemLanguageResultExecution timeMemory
624796rm1729Programiranje (COCI17_programiranje)C++17
80 / 80
134 ms11892 KiB
#include <bits/stdc++.h> using namespace std; #define int long long void solve(){ string a; cin >>a; vector <vector <int>> pref(26, vector <int> (a.length()+1,0)); for(int i=1; i<=a.length(); i++){ for(int j=0; j<26; j++){ pref[j][i]=pref[j][i-1]; } int x = (int) a[i-1]-97; pref[x][i]++; } int Q; cin >>Q; for(int i=0; i<Q; i++){ int a,b,c,d; cin >>a>>b>>c>>d; bool flag = false; for(int j=0; j<26; j++){ if(pref[j][b]-pref[j][a-1]!=pref[j][d]-pref[j][c-1]){ flag = true; break; } } if(flag){ cout <<"NE"<<endl; } else{ cout <<"DA"<<endl; } } } signed main(){ int t=1;// cin >>t; while(t--){ solve(); } return 0; }

Compilation message (stderr)

programiranje.cpp: In function 'void solve()':
programiranje.cpp:9: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]
    9 |     for(int i=1; i<=a.length(); i++){
      |                  ~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...