# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
257143 |
2020-08-03T16:15:19 Z |
islingr |
Sticks (POI11_pat) |
C++17 |
|
225 ms |
4656 KB |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (auto i = (a); i < (b); ++i)
#define all(x) begin(x), end(x)
const int K = 1 << 6;
vector<int> s[K];
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int k; cin >> k;
rep(i, 0, k) {
int n; cin >> n;
s[i].resize(n);
for (auto &x : s[i]) cin >> x;
sort(all(s[i]));
}
rep(ca, 0, k) {
for (int a : s[ca]) {
int b = -1, cb = -1, c = -1, cc = -1;
rep(i, 0, k) {
if (i == ca) continue;
auto it = upper_bound(all(s[i]), a);
if (it-- == begin(s[i])) continue;
if (b <= *it) {
c = b; cc = cb;
b = *it; cb = i;
} else if (c < *it) c = *it, cc = i;
}
if (c < 0) continue;
if (b + c > a) return cout << ++ca << ' ' << a << ' ' << ++cb << ' ' << b << ' ' << ++cc << ' ' << c, 0;
}
}
cout << "NIE";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
2 |
Correct |
0 ms |
384 KB |
Oczekiwano NIE |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Oczekiwano NIE |
2 |
Correct |
7 ms |
640 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Oczekiwano NIE |
2 |
Correct |
14 ms |
648 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Oczekiwano NIE |
2 |
Correct |
19 ms |
1024 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
512 KB |
Oczekiwano NIE |
2 |
Correct |
30 ms |
1152 KB |
Output is correct |
3 |
Correct |
45 ms |
1024 KB |
Oczekiwano NIE |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
33 ms |
768 KB |
Oczekiwano NIE |
2 |
Correct |
54 ms |
1660 KB |
Output is correct |
3 |
Correct |
61 ms |
1272 KB |
Oczekiwano NIE |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
109 ms |
2680 KB |
Output is correct |
2 |
Correct |
82 ms |
2040 KB |
Output is correct |
3 |
Correct |
84 ms |
1528 KB |
Oczekiwano NIE |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
106 ms |
2680 KB |
Output is correct |
2 |
Correct |
94 ms |
2168 KB |
Output is correct |
3 |
Correct |
132 ms |
1788 KB |
Oczekiwano NIE |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
225 ms |
4656 KB |
Output is correct |
2 |
Correct |
145 ms |
2296 KB |
Output is correct |
3 |
Correct |
173 ms |
2552 KB |
Oczekiwano NIE |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
219 ms |
4620 KB |
Output is correct |
2 |
Correct |
97 ms |
2552 KB |
Output is correct |
3 |
Correct |
223 ms |
2808 KB |
Oczekiwano NIE |