Submission #575376

#TimeUsernameProblemLanguageResultExecution timeMemory
575376d4xnMountains (IOI17_mountains)C++17
0 / 100
1 ms212 KiB
#pragma GCC optimize ("Ofast") #include "mountains.h" #include <bits/stdc++.h> using namespace std; #define ld long double #define ll long long const int N = 2002; ll n, ans; vector<pair<ll, ll>> v, taken; int maximum_deevs(vector<int> y) { n = y.size(); ans = 0; v.resize(n); for(ll i = 0; i < n; i++) { v[i] = make_pair(y[i], i); } sort(v.begin(), v.end()); for(ll i = 0; i < n; i++) { bool ok = 1; for (ll j = 0; j < taken.size(); j++) { // comprobar si se puede coger } if (ok) taken.push_back(make_pair(v[i].second, v[i].first)); } ll sz = taken.size(); return max(sz, 1ll); }

Compilation message (stderr)

mountains.cpp: In function 'int maximum_deevs(std::vector<int>)':
mountains.cpp:24:28: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |           for (ll j = 0; j < taken.size(); j++) {
      |                          ~~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...