(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #340309

#TimeUsernameProblemLanguageResultExecution timeMemory
340309ammar2000Grudanje (COCI19_grudanje)C++17
0 / 70
2098 ms8300 KiB
#include <bits/stdc++.h> using namespace std; int ans,q,st[100000],e[100000],b; map <int ,int > mp; vector <int> v; string s; int main() { cin>>s>>q; for (int i=0;i<q;++i) cin>>st[i]>>e[i]; for (int i=0;i<s.length();i++) { int t; cin>>t; mp[t]=i+1; } for (int i=0;i<q;++i) { for (int y=st[i]-1;y<e[i];y++) if (s[y]=='a') v.push_back(mp[y+1]); sort (v.begin(),v.end()); v.pop_back(); ans=max(ans,v.back()); v.clear(); } cout <<ans; return 0; }

Compilation message (stderr)

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