Submission #1086495

#TimeUsernameProblemLanguageResultExecution timeMemory
1086495toast12Programiranje (COCI17_programiranje)C++14
80 / 80
29 ms7104 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(NULL); string s; cin >> s; vector<vector<int>> ps(26, vector<int>(s.length()+1)); for (int j = 1; j <= s.length(); j++) { for (int i = 0; i < 26; i++) { ps[i][j] = ps[i][j-1]; if (i == s[j-1]-'a') ps[i][j]++; } } int q; cin >> q; while (q--) { int a, b, c, d; cin >> a >> b >> c >> d; bool ans = true; for (int i = 0; i < 26; i++) { if (ps[i][b]-ps[i][a-1] != ps[i][d]-ps[i][c-1]) { ans = false; break; } } if (ans) cout << "DA\n"; else cout << "NE\n"; } return 0; }

Compilation message (stderr)

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