# | Submission time^{} |
Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|

957160 | 2024-04-03T05:50:20 Z | duckindog | Aliens (IOI16_aliens) | C++17 | 1 ms | 600 KB |

#include <bits/stdc++.h> using namespace std; #ifndef LOCAL #include "aliens.h" #endif long long take_photos(int n, int m, int k, vector<int> r, vector<int> c) { using pii = pair<int, int>; vector<pii> p(n); vector<vector<long long>> f(k + 1, vector<long long>(n + 1, 1e15)); for (int i = 0; i < n; ++i) p[i] = {r[i], c[i]}; if (n <= 50 && m <= 100 && k == n) { vector<vector<bool>> mk(m, vector<bool>(m)); for (int i = 0; i < n; ++i) { auto [x, y] = p[i]; if (x > y) swap(x, y); for (int i = x; i <= y; ++i) { for (int j = x; j <= y; ++j) mk[i][j] = true; } } int answer = 0; for (int i = 0; i < m; ++i) for (int j = 0; j < m; ++j) answer += mk[i][j]; return answer; } auto dis = [&](pii a) { return abs(a.first - a.second) + 1; }; sort(p.begin(), p.end(), [&](const auto& a, const auto& b) { return make_pair(a.first, dis(a)) < make_pair(b.first, dis(b)); }); return 0; } #ifdef LOCAL int32_t main() { cin.tie(0)->sync_with_stdio(0); int n, m, k; cin >> n >> m >> k; vector<int> r(n), c(n); for (int i = 0; i < n; ++i) cin >> r[i] >> c[i]; cout << take_photos(n, m, k, r, c) << "\n"; } #endif

# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|

1 | Correct | 0 ms | 348 KB | Correct answer: answer = 4 |

2 | Correct | 1 ms | 348 KB | Correct answer: answer = 4 |

3 | Correct | 0 ms | 348 KB | Correct answer: answer = 4 |

4 | Correct | 0 ms | 348 KB | Correct answer: answer = 12 |

5 | Correct | 0 ms | 348 KB | Correct answer: answer = 52 |

6 | Correct | 0 ms | 348 KB | Correct answer: answer = 210 |

7 | Correct | 1 ms | 348 KB | Correct answer: answer = 88 |

8 | Correct | 0 ms | 348 KB | Correct answer: answer = 7696 |

9 | Correct | 0 ms | 436 KB | Correct answer: answer = 1 |

10 | Correct | 1 ms | 348 KB | Correct answer: answer = 2374 |

11 | Correct | 0 ms | 348 KB | Correct answer: answer = 9502 |

12 | Correct | 0 ms | 348 KB | Correct answer: answer = 49 |

13 | Correct | 0 ms | 348 KB | Correct answer: answer = 151 |

14 | Correct | 1 ms | 348 KB | Correct answer: answer = 7550 |

15 | Correct | 1 ms | 348 KB | Correct answer: answer = 7220 |

16 | Correct | 1 ms | 344 KB | Correct answer: answer = 7550 |

17 | Correct | 1 ms | 348 KB | Correct answer: answer = 10000 |

18 | Correct | 1 ms | 348 KB | Correct answer: answer = 10000 |

19 | Correct | 0 ms | 348 KB | Correct answer: answer = 624 |

20 | Correct | 1 ms | 600 KB | Correct answer: answer = 10000 |

# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|

1 | Correct | 0 ms | 348 KB | Correct answer: answer = 1 |

2 | Incorrect | 0 ms | 348 KB | Wrong answer: output = 0, expected = 4 |

3 | Halted | 0 ms | 0 KB | - |

# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|

1 | Correct | 0 ms | 348 KB | Correct answer: answer = 4 |

2 | Correct | 1 ms | 348 KB | Correct answer: answer = 4 |

3 | Correct | 0 ms | 348 KB | Correct answer: answer = 4 |

4 | Correct | 0 ms | 348 KB | Correct answer: answer = 12 |

5 | Correct | 0 ms | 348 KB | Correct answer: answer = 52 |

6 | Correct | 0 ms | 348 KB | Correct answer: answer = 210 |

7 | Correct | 1 ms | 348 KB | Correct answer: answer = 88 |

8 | Correct | 0 ms | 348 KB | Correct answer: answer = 7696 |

9 | Correct | 0 ms | 436 KB | Correct answer: answer = 1 |

10 | Correct | 1 ms | 348 KB | Correct answer: answer = 2374 |

11 | Correct | 0 ms | 348 KB | Correct answer: answer = 9502 |

12 | Correct | 0 ms | 348 KB | Correct answer: answer = 49 |

13 | Correct | 0 ms | 348 KB | Correct answer: answer = 151 |

14 | Correct | 1 ms | 348 KB | Correct answer: answer = 7550 |

15 | Correct | 1 ms | 348 KB | Correct answer: answer = 7220 |

16 | Correct | 1 ms | 344 KB | Correct answer: answer = 7550 |

17 | Correct | 1 ms | 348 KB | Correct answer: answer = 10000 |

18 | Correct | 1 ms | 348 KB | Correct answer: answer = 10000 |

19 | Correct | 0 ms | 348 KB | Correct answer: answer = 624 |

20 | Correct | 1 ms | 600 KB | Correct answer: answer = 10000 |

21 | Correct | 0 ms | 348 KB | Correct answer: answer = 1 |

22 | Incorrect | 0 ms | 348 KB | Wrong answer: output = 0, expected = 4 |

23 | Halted | 0 ms | 0 KB | - |

# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|

1 | Correct | 0 ms | 348 KB | Correct answer: answer = 4 |

2 | Correct | 1 ms | 348 KB | Correct answer: answer = 4 |

3 | Correct | 0 ms | 348 KB | Correct answer: answer = 4 |

4 | Correct | 0 ms | 348 KB | Correct answer: answer = 12 |

5 | Correct | 0 ms | 348 KB | Correct answer: answer = 52 |

6 | Correct | 0 ms | 348 KB | Correct answer: answer = 210 |

7 | Correct | 1 ms | 348 KB | Correct answer: answer = 88 |

8 | Correct | 0 ms | 348 KB | Correct answer: answer = 7696 |

9 | Correct | 0 ms | 436 KB | Correct answer: answer = 1 |

10 | Correct | 1 ms | 348 KB | Correct answer: answer = 2374 |

11 | Correct | 0 ms | 348 KB | Correct answer: answer = 9502 |

12 | Correct | 0 ms | 348 KB | Correct answer: answer = 49 |

13 | Correct | 0 ms | 348 KB | Correct answer: answer = 151 |

14 | Correct | 1 ms | 348 KB | Correct answer: answer = 7550 |

15 | Correct | 1 ms | 348 KB | Correct answer: answer = 7220 |

16 | Correct | 1 ms | 344 KB | Correct answer: answer = 7550 |

17 | Correct | 1 ms | 348 KB | Correct answer: answer = 10000 |

18 | Correct | 1 ms | 348 KB | Correct answer: answer = 10000 |

19 | Correct | 0 ms | 348 KB | Correct answer: answer = 624 |

20 | Correct | 1 ms | 600 KB | Correct answer: answer = 10000 |

21 | Correct | 0 ms | 348 KB | Correct answer: answer = 1 |

22 | Incorrect | 0 ms | 348 KB | Wrong answer: output = 0, expected = 4 |

23 | Halted | 0 ms | 0 KB | - |

# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|

1 | Correct | 0 ms | 348 KB | Correct answer: answer = 4 |

2 | Correct | 1 ms | 348 KB | Correct answer: answer = 4 |

3 | Correct | 0 ms | 348 KB | Correct answer: answer = 4 |

4 | Correct | 0 ms | 348 KB | Correct answer: answer = 12 |

5 | Correct | 0 ms | 348 KB | Correct answer: answer = 52 |

6 | Correct | 0 ms | 348 KB | Correct answer: answer = 210 |

7 | Correct | 1 ms | 348 KB | Correct answer: answer = 88 |

8 | Correct | 0 ms | 348 KB | Correct answer: answer = 7696 |

9 | Correct | 0 ms | 436 KB | Correct answer: answer = 1 |

10 | Correct | 1 ms | 348 KB | Correct answer: answer = 2374 |

11 | Correct | 0 ms | 348 KB | Correct answer: answer = 9502 |

12 | Correct | 0 ms | 348 KB | Correct answer: answer = 49 |

13 | Correct | 0 ms | 348 KB | Correct answer: answer = 151 |

14 | Correct | 1 ms | 348 KB | Correct answer: answer = 7550 |

15 | Correct | 1 ms | 348 KB | Correct answer: answer = 7220 |

16 | Correct | 1 ms | 344 KB | Correct answer: answer = 7550 |

17 | Correct | 1 ms | 348 KB | Correct answer: answer = 10000 |

18 | Correct | 1 ms | 348 KB | Correct answer: answer = 10000 |

19 | Correct | 0 ms | 348 KB | Correct answer: answer = 624 |

20 | Correct | 1 ms | 600 KB | Correct answer: answer = 10000 |

21 | Correct | 0 ms | 348 KB | Correct answer: answer = 1 |

22 | Incorrect | 0 ms | 348 KB | Wrong answer: output = 0, expected = 4 |

23 | Halted | 0 ms | 0 KB | - |

# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|

1 | Correct | 0 ms | 348 KB | Correct answer: answer = 4 |

2 | Correct | 1 ms | 348 KB | Correct answer: answer = 4 |

3 | Correct | 0 ms | 348 KB | Correct answer: answer = 4 |

4 | Correct | 0 ms | 348 KB | Correct answer: answer = 12 |

5 | Correct | 0 ms | 348 KB | Correct answer: answer = 52 |

6 | Correct | 0 ms | 348 KB | Correct answer: answer = 210 |

7 | Correct | 1 ms | 348 KB | Correct answer: answer = 88 |

8 | Correct | 0 ms | 348 KB | Correct answer: answer = 7696 |

9 | Correct | 0 ms | 436 KB | Correct answer: answer = 1 |

10 | Correct | 1 ms | 348 KB | Correct answer: answer = 2374 |

11 | Correct | 0 ms | 348 KB | Correct answer: answer = 9502 |

12 | Correct | 0 ms | 348 KB | Correct answer: answer = 49 |

13 | Correct | 0 ms | 348 KB | Correct answer: answer = 151 |

14 | Correct | 1 ms | 348 KB | Correct answer: answer = 7550 |

15 | Correct | 1 ms | 348 KB | Correct answer: answer = 7220 |

16 | Correct | 1 ms | 344 KB | Correct answer: answer = 7550 |

17 | Correct | 1 ms | 348 KB | Correct answer: answer = 10000 |

18 | Correct | 1 ms | 348 KB | Correct answer: answer = 10000 |

19 | Correct | 0 ms | 348 KB | Correct answer: answer = 624 |

20 | Correct | 1 ms | 600 KB | Correct answer: answer = 10000 |

21 | Correct | 0 ms | 348 KB | Correct answer: answer = 1 |

22 | Incorrect | 0 ms | 348 KB | Wrong answer: output = 0, expected = 4 |

23 | Halted | 0 ms | 0 KB | - |