Submission #776836

#TimeUsernameProblemLanguageResultExecution timeMemory
776836aZvezdaTeam Contest (JOI22_team)C++14
8 / 100
2052 ms1736 KiB
#include <bits/stdc++.h> typedef long long ll; using namespace std; const ll MAX_N = 1e5 + 10; ll n; pair<ll, pair<int, int> > p[MAX_N]; deque<ll> down, up; void put_down(ll ind) { down.push_back(ind); } void put_up(ll ind) { up.push_back(ind); } signed main() { cin >> n; for(ll i = 0; i < n; i ++) { cin >> p[i].first >> p[i].second.first >> p[i].second.second; } sort(p, p + n); ll ptr = 0; ll ans = -1; for(ll i = 0; i < n; i ++) { while(ptr < i && p[ptr].first != p[i].first) { put_down(ptr); put_up(ptr); ptr ++; } for(ll j = 0; j < down.size(); j ++) { for(ll k = 0; k < up.size(); k ++) { int indj = down[j]; int indk = down[k]; if( p[indj].second.first > p[indk].second.first && p[indj].second.first > p[i].second.first && p[indj].second.second < p[indk].second.second && p[i].second.second < p[indk].second.second ) { ans = max(ans, p[down[j]].second.first + p[up[k]].second.second + p[i].first); } } } } cout << ans << endl; return 0; }

Compilation message (stderr)

team.cpp: In function 'int main()':
team.cpp:34:19: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::deque<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |   for(ll j = 0; j < down.size(); j ++) {
      |                 ~~^~~~~~~~~~~~~
team.cpp:35:20: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::deque<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |    for(ll k = 0; k < up.size(); k ++) {
      |                  ~~^~~~~~~~~~~
#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...