# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
168675 | pr3pony | Sticks (POI11_pat) | C++14 | 264 ms | 17964 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |