Submission #168675

#TimeUsernameProblemLanguageResultExecution timeMemory
168675pr3ponySticks (POI11_pat)C++14
100 / 100
264 ms17964 KiB
#include<bits/stdc++.h> using namespace std; typedef pair<int,int> pii; #define F first #define S second int main() { ios::sync_with_stdio(0); cin.tie(0); int k; cin >> k; vector<pii> vp; for (int i = 0; i < k; ++i) { int w; cin >> w; for (int j = 0; j < w; ++j) { int l; cin >> l; vp.emplace_back(l, i + 1); } } sort(begin(vp), end(vp)); deque<pii> dk; for (const auto & p : vp) { for (int i = 0; i < dk.size(); ++i) if (dk[i].S == p.S) { dk.erase(begin(dk) + i); break; } dk.push_front(p); if (dk.size() > 3) dk.pop_back(); if (dk.size() == 3 && dk[1].F + dk[2].F > dk[0].F) { for (int i = 0; i < 3; ++i) cout << dk[i].S << ' ' << dk[i].F << " \n"[i == 2]; return 0; } } cout << "NIE\n"; }

Compilation message (stderr)

pat.cpp: In function 'int main()':
pat.cpp:25:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int i = 0; i < dk.size(); ++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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...