# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
257113 |
2020-08-03T15:40:53 Z |
islingr |
Sticks (POI11_pat) |
C++17 |
|
222 ms |
4600 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)
#define ub(x...) upper_bound(x)
const int K = 1 << 6;
vector<int> s[K];
bool ckmax(auto &a, const auto &b) { return a < b ? a = b, 1 : 0; }
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, c = -1, cc;
rep(i, 0, k) {
if (i == ca) continue;
auto it = ub(all(s[i]), a);
if (it == begin(s[i])) continue;
if (ckmax(b, *prev(it))) cb = i;
}
if (b < 0) continue;
rep(i, 0, k) {
if (i == ca || i == cb) continue;
auto it = ub(all(s[i]), b);
if (it == begin(s[i])) continue;
if (ckmax(c, *prev(it))) cc = i;
}
if (c < 0) continue;
++ca; ++cb; ++cc;
if (b + c > a)
return cout << ca << ' ' << a << ' ' << cb << ' ' << b << ' ' << cc << ' ' << c, 0;
}
}
cout << "NIE\n";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 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 |
Incorrect |
1 ms |
384 KB |
Expected EOF |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Expected EOF |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Expected EOF |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Expected EOF |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
640 KB |
Expected EOF |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
15 ms |
1024 KB |
Expected EOF |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
110 ms |
2552 KB |
Output is correct |
2 |
Correct |
76 ms |
1888 KB |
Output is correct |
3 |
Incorrect |
48 ms |
1656 KB |
Expected EOF |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
113 ms |
2552 KB |
Output is correct |
2 |
Correct |
74 ms |
2040 KB |
Output is correct |
3 |
Incorrect |
94 ms |
1912 KB |
Expected EOF |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
219 ms |
4600 KB |
Output is correct |
2 |
Correct |
84 ms |
2168 KB |
Output is correct |
3 |
Incorrect |
92 ms |
2424 KB |
Expected EOF |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
222 ms |
4472 KB |
Output is correct |
2 |
Correct |
95 ms |
2424 KB |
Output is correct |
3 |
Incorrect |
106 ms |
2808 KB |
Expected EOF |