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

370157 | 2021-02-23T12:50:26 Z | KoD | Aliens (IOI16_aliens) | C++17 | 178 ms | 5464 KB |

#include <bits/stdc++.h> #include "aliens.h" template <class T> using Vec = std::vector<T>; using ll = long long; using bigll = __int128_t; constexpr ll square(const ll x) { return x * x; } struct Line { ll a, b; ll get(const ll x) const { return a * x + b; } }; struct CHT { std::deque<Line> line; CHT(): line() { } void add(const Line &l) { while (line.size() >= 2) { const auto &m = line[line.size() - 1]; const auto &n = line[line.size() - 2]; if (bigll(m.b - n.b) * bigll(m.a - l.a) < bigll(l.b - m.b) * bigll(n.a - m.a)) { break; } line.pop_back(); } line.push_back(l); } ll get(const ll x) { while (line.size() >= 2) { const auto &m = line[0]; const auto &n = line[1]; if (m.get(x) < n.get(x)) { break; } line.pop_front(); } return line[0].get(x); } }; ll take_photos(int n, int m, int k, Vec<int> r, Vec<int> c) { Vec<std::pair<int, int>> star; { for (int i = 0; i < n; ++i) { if (r[i] > c[i]) { std::swap(r[i], c[i]); } c[i] += 1; } Vec<int> order(n); std::iota(order.begin(), order.end(), (int) 0); std::sort(order.begin(), order.end(), [&](const int i, const int j) { if (r[i] == r[j]) return c[i] > c[j]; return r[i] < r[j]; }); int last_c = -1; for (const int i: order) { if (last_c < c[i]) { star.emplace_back(r[i], c[i]); last_c = c[i]; } } } n = (int) star.size(); k = std::min(k, n); const ll fix_coeff = n + 1; const auto compute = [&](const ll penalty) { Vec<ll> dp(n + 1); CHT cht; for (int i = 0; i < n; ++i) { const ll a = fix_coeff * (-2 * star[i].first); const ll dup = (i == 0 ? 0 : std::max(star[i - 1].second - star[i].first, 0)); const ll b = dp[i] + fix_coeff * (square(star[i].first) - square(dup)); cht.add(Line { a, b }); dp[i + 1] = cht.get(star[i].second) + fix_coeff * (square(star[i].second) + penalty) + 1; } return std::make_pair(dp[n] / fix_coeff, dp[n] % fix_coeff); }; ll ng = -1, ok = (ll) m * m + 1; while (ok - ng > 1) { const ll md = (ok + ng) / 2; (compute(md).second <= k ? ok : ng) = md; } const auto p1 = compute(ok); const auto p2 = compute(ng); const auto a = p1.first - ok * p1.second; const auto b = p2.first - ng * p2.second; const auto s = k - p1.second; const auto t = p2.second - k; return s == 0 ? a : (a * t + b * s) / (s + t); }

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

1 | Correct | 1 ms | 512 KB | Correct answer: answer = 4 |

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

3 | Correct | 1 ms | 364 KB | Correct answer: answer = 4 |

4 | Correct | 1 ms | 364 KB | Correct answer: answer = 12 |

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

6 | Correct | 1 ms | 364 KB | Correct answer: answer = 210 |

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

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

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

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

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

12 | Correct | 1 ms | 364 KB | Correct answer: answer = 49 |

13 | Correct | 1 ms | 364 KB | Correct answer: answer = 151 |

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

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

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

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

18 | Correct | 0 ms | 364 KB | Correct answer: answer = 10000 |

19 | Correct | 1 ms | 364 KB | Correct answer: answer = 624 |

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

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

1 | Correct | 1 ms | 364 KB | Correct answer: answer = 1 |

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

3 | Correct | 0 ms | 364 KB | Correct answer: answer = 1 |

4 | Correct | 1 ms | 364 KB | Correct answer: answer = 5 |

5 | Correct | 1 ms | 364 KB | Correct answer: answer = 41 |

6 | Correct | 1 ms | 268 KB | Correct answer: answer = 71923 |

7 | Correct | 1 ms | 364 KB | Correct answer: answer = 77137 |

8 | Correct | 1 ms | 364 KB | Correct answer: answer = 764 |

9 | Correct | 1 ms | 364 KB | Correct answer: answer = 250000 |

10 | Correct | 1 ms | 364 KB | Correct answer: answer = 500 |

11 | Correct | 1 ms | 364 KB | Correct answer: answer = 32 |

12 | Correct | 1 ms | 364 KB | Correct answer: answer = 130050 |

13 | Correct | 1 ms | 364 KB | Correct answer: answer = 5110 |

14 | Correct | 1 ms | 364 KB | Correct answer: answer = 2626 |

15 | Correct | 1 ms | 364 KB | Correct answer: answer = 796 |

16 | Correct | 1 ms | 364 KB | Correct answer: answer = 7580 |

17 | Correct | 1 ms | 364 KB | Correct answer: answer = 1904 |

18 | Correct | 1 ms | 364 KB | Correct answer: answer = 996004 |

19 | Correct | 1 ms | 364 KB | Correct answer: answer = 38817 |

20 | Correct | 1 ms | 364 KB | Correct answer: answer = 4096 |

21 | Correct | 1 ms | 364 KB | Correct answer: answer = 1 |

22 | Correct | 1 ms | 364 KB | Correct answer: answer = 1 |

23 | Correct | 1 ms | 364 KB | Correct answer: answer = 2040 |

24 | Correct | 1 ms | 384 KB | Correct answer: answer = 2 |

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

1 | Correct | 1 ms | 512 KB | Correct answer: answer = 4 |

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

3 | Correct | 1 ms | 364 KB | Correct answer: answer = 4 |

4 | Correct | 1 ms | 364 KB | Correct answer: answer = 12 |

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

6 | Correct | 1 ms | 364 KB | Correct answer: answer = 210 |

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

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

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

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

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

12 | Correct | 1 ms | 364 KB | Correct answer: answer = 49 |

13 | Correct | 1 ms | 364 KB | Correct answer: answer = 151 |

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

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

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

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

18 | Correct | 0 ms | 364 KB | Correct answer: answer = 10000 |

19 | Correct | 1 ms | 364 KB | Correct answer: answer = 624 |

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

21 | Correct | 1 ms | 364 KB | Correct answer: answer = 1 |

22 | Correct | 1 ms | 364 KB | Correct answer: answer = 4 |

23 | Correct | 0 ms | 364 KB | Correct answer: answer = 1 |

24 | Correct | 1 ms | 364 KB | Correct answer: answer = 5 |

25 | Correct | 1 ms | 364 KB | Correct answer: answer = 41 |

26 | Correct | 1 ms | 268 KB | Correct answer: answer = 71923 |

27 | Correct | 1 ms | 364 KB | Correct answer: answer = 77137 |

28 | Correct | 1 ms | 364 KB | Correct answer: answer = 764 |

29 | Correct | 1 ms | 364 KB | Correct answer: answer = 250000 |

30 | Correct | 1 ms | 364 KB | Correct answer: answer = 500 |

31 | Correct | 1 ms | 364 KB | Correct answer: answer = 32 |

32 | Correct | 1 ms | 364 KB | Correct answer: answer = 130050 |

33 | Correct | 1 ms | 364 KB | Correct answer: answer = 5110 |

34 | Correct | 1 ms | 364 KB | Correct answer: answer = 2626 |

35 | Correct | 1 ms | 364 KB | Correct answer: answer = 796 |

36 | Correct | 1 ms | 364 KB | Correct answer: answer = 7580 |

37 | Correct | 1 ms | 364 KB | Correct answer: answer = 1904 |

38 | Correct | 1 ms | 364 KB | Correct answer: answer = 996004 |

39 | Correct | 1 ms | 364 KB | Correct answer: answer = 38817 |

40 | Correct | 1 ms | 364 KB | Correct answer: answer = 4096 |

41 | Correct | 1 ms | 364 KB | Correct answer: answer = 1 |

42 | Correct | 1 ms | 364 KB | Correct answer: answer = 1 |

43 | Correct | 1 ms | 364 KB | Correct answer: answer = 2040 |

44 | Correct | 1 ms | 384 KB | Correct answer: answer = 2 |

45 | Correct | 1 ms | 364 KB | Correct answer: answer = 4 |

46 | Correct | 1 ms | 364 KB | Correct answer: answer = 9 |

47 | Correct | 1 ms | 364 KB | Correct answer: answer = 9 |

48 | Correct | 1 ms | 364 KB | Correct answer: answer = 21 |

49 | Correct | 1 ms | 364 KB | Correct answer: answer = 71 |

50 | Correct | 0 ms | 364 KB | Correct answer: answer = 77 |

51 | Correct | 1 ms | 364 KB | Correct answer: answer = 400 |

52 | Correct | 1 ms | 364 KB | Correct answer: answer = 996004 |

53 | Correct | 1 ms | 364 KB | Correct answer: answer = 997310 |

54 | Correct | 1 ms | 364 KB | Correct answer: answer = 990781 |

55 | Correct | 1 ms | 364 KB | Correct answer: answer = 996545 |

56 | Correct | 1 ms | 364 KB | Correct answer: answer = 484 |

57 | Correct | 1 ms | 384 KB | Correct answer: answer = 484 |

58 | Correct | 1 ms | 364 KB | Correct answer: answer = 63501 |

59 | Correct | 1 ms | 364 KB | Correct answer: answer = 323501 |

60 | Correct | 1 ms | 364 KB | Correct answer: answer = 752500 |

61 | Correct | 1 ms | 364 KB | Correct answer: answer = 761480 |

62 | Correct | 1 ms | 364 KB | Correct answer: answer = 758932 |

63 | Correct | 1 ms | 384 KB | Correct answer: answer = 1000000 |

64 | Correct | 1 ms | 364 KB | Correct answer: answer = 750500 |

65 | Correct | 1 ms | 364 KB | Correct answer: answer = 1000000 |

66 | Correct | 1 ms | 364 KB | Correct answer: answer = 250000 |

67 | Correct | 1 ms | 364 KB | Correct answer: answer = 250000 |

68 | Correct | 1 ms | 364 KB | Correct answer: answer = 1000000 |

69 | Correct | 1 ms | 364 KB | Correct answer: answer = 994009 |

70 | Correct | 1 ms | 364 KB | Correct answer: answer = 59315 |

71 | Correct | 1 ms | 364 KB | Correct answer: answer = 25454 |

72 | Correct | 1 ms | 364 KB | Correct answer: answer = 1504 |

73 | Correct | 1 ms | 364 KB | Correct answer: answer = 37486 |

74 | Correct | 1 ms | 364 KB | Correct answer: answer = 4284 |

75 | Correct | 1 ms | 364 KB | Correct answer: answer = 158008 |

76 | Correct | 1 ms | 364 KB | Correct answer: answer = 51860 |

77 | Correct | 1 ms | 364 KB | Correct answer: answer = 12985 |

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

1 | Correct | 1 ms | 512 KB | Correct answer: answer = 4 |

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

3 | Correct | 1 ms | 364 KB | Correct answer: answer = 4 |

4 | Correct | 1 ms | 364 KB | Correct answer: answer = 12 |

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

6 | Correct | 1 ms | 364 KB | Correct answer: answer = 210 |

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

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

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

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

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

12 | Correct | 1 ms | 364 KB | Correct answer: answer = 49 |

13 | Correct | 1 ms | 364 KB | Correct answer: answer = 151 |

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

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

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

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

18 | Correct | 0 ms | 364 KB | Correct answer: answer = 10000 |

19 | Correct | 1 ms | 364 KB | Correct answer: answer = 624 |

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

21 | Correct | 1 ms | 364 KB | Correct answer: answer = 1 |

22 | Correct | 1 ms | 364 KB | Correct answer: answer = 4 |

23 | Correct | 0 ms | 364 KB | Correct answer: answer = 1 |

24 | Correct | 1 ms | 364 KB | Correct answer: answer = 5 |

25 | Correct | 1 ms | 364 KB | Correct answer: answer = 41 |

26 | Correct | 1 ms | 268 KB | Correct answer: answer = 71923 |

27 | Correct | 1 ms | 364 KB | Correct answer: answer = 77137 |

28 | Correct | 1 ms | 364 KB | Correct answer: answer = 764 |

29 | Correct | 1 ms | 364 KB | Correct answer: answer = 250000 |

30 | Correct | 1 ms | 364 KB | Correct answer: answer = 500 |

31 | Correct | 1 ms | 364 KB | Correct answer: answer = 32 |

32 | Correct | 1 ms | 364 KB | Correct answer: answer = 130050 |

33 | Correct | 1 ms | 364 KB | Correct answer: answer = 5110 |

34 | Correct | 1 ms | 364 KB | Correct answer: answer = 2626 |

35 | Correct | 1 ms | 364 KB | Correct answer: answer = 796 |

36 | Correct | 1 ms | 364 KB | Correct answer: answer = 7580 |

37 | Correct | 1 ms | 364 KB | Correct answer: answer = 1904 |

38 | Correct | 1 ms | 364 KB | Correct answer: answer = 996004 |

39 | Correct | 1 ms | 364 KB | Correct answer: answer = 38817 |

40 | Correct | 1 ms | 364 KB | Correct answer: answer = 4096 |

41 | Correct | 1 ms | 364 KB | Correct answer: answer = 1 |

42 | Correct | 1 ms | 364 KB | Correct answer: answer = 1 |

43 | Correct | 1 ms | 364 KB | Correct answer: answer = 2040 |

44 | Correct | 1 ms | 384 KB | Correct answer: answer = 2 |

45 | Correct | 1 ms | 364 KB | Correct answer: answer = 4 |

46 | Correct | 1 ms | 364 KB | Correct answer: answer = 9 |

47 | Correct | 1 ms | 364 KB | Correct answer: answer = 9 |

48 | Correct | 1 ms | 364 KB | Correct answer: answer = 21 |

49 | Correct | 1 ms | 364 KB | Correct answer: answer = 71 |

50 | Correct | 0 ms | 364 KB | Correct answer: answer = 77 |

51 | Correct | 1 ms | 364 KB | Correct answer: answer = 400 |

52 | Correct | 1 ms | 364 KB | Correct answer: answer = 996004 |

53 | Correct | 1 ms | 364 KB | Correct answer: answer = 997310 |

54 | Correct | 1 ms | 364 KB | Correct answer: answer = 990781 |

55 | Correct | 1 ms | 364 KB | Correct answer: answer = 996545 |

56 | Correct | 1 ms | 364 KB | Correct answer: answer = 484 |

57 | Correct | 1 ms | 384 KB | Correct answer: answer = 484 |

58 | Correct | 1 ms | 364 KB | Correct answer: answer = 63501 |

59 | Correct | 1 ms | 364 KB | Correct answer: answer = 323501 |

60 | Correct | 1 ms | 364 KB | Correct answer: answer = 752500 |

61 | Correct | 1 ms | 364 KB | Correct answer: answer = 761480 |

62 | Correct | 1 ms | 364 KB | Correct answer: answer = 758932 |

63 | Correct | 1 ms | 384 KB | Correct answer: answer = 1000000 |

64 | Correct | 1 ms | 364 KB | Correct answer: answer = 750500 |

65 | Correct | 1 ms | 364 KB | Correct answer: answer = 1000000 |

66 | Correct | 1 ms | 364 KB | Correct answer: answer = 250000 |

67 | Correct | 1 ms | 364 KB | Correct answer: answer = 250000 |

68 | Correct | 1 ms | 364 KB | Correct answer: answer = 1000000 |

69 | Correct | 1 ms | 364 KB | Correct answer: answer = 994009 |

70 | Correct | 1 ms | 364 KB | Correct answer: answer = 59315 |

71 | Correct | 1 ms | 364 KB | Correct answer: answer = 25454 |

72 | Correct | 1 ms | 364 KB | Correct answer: answer = 1504 |

73 | Correct | 1 ms | 364 KB | Correct answer: answer = 37486 |

74 | Correct | 1 ms | 364 KB | Correct answer: answer = 4284 |

75 | Correct | 1 ms | 364 KB | Correct answer: answer = 158008 |

76 | Correct | 1 ms | 364 KB | Correct answer: answer = 51860 |

77 | Correct | 1 ms | 364 KB | Correct answer: answer = 12985 |

78 | Correct | 2 ms | 364 KB | Correct answer: answer = 997864126212 |

79 | Correct | 2 ms | 364 KB | Correct answer: answer = 998608411647 |

80 | Correct | 2 ms | 364 KB | Correct answer: answer = 995265560477 |

81 | Correct | 6 ms | 492 KB | Correct answer: answer = 10125000 |

82 | Correct | 5 ms | 492 KB | Correct answer: answer = 2291668 |

83 | Correct | 4 ms | 364 KB | Correct answer: answer = 42388 |

84 | Correct | 3 ms | 364 KB | Correct answer: answer = 10318 |

85 | Correct | 2 ms | 364 KB | Correct answer: answer = 3416 |

86 | Correct | 9 ms | 492 KB | Correct answer: answer = 331708193881 |

87 | Correct | 8 ms | 492 KB | Correct answer: answer = 2861193756 |

88 | Correct | 7 ms | 492 KB | Correct answer: answer = 114646930 |

89 | Correct | 5 ms | 492 KB | Correct answer: answer = 9280921 |

90 | Correct | 6 ms | 492 KB | Correct answer: answer = 999984053400 |

91 | Correct | 7 ms | 492 KB | Correct answer: answer = 750935949134 |

92 | Correct | 2 ms | 364 KB | Correct answer: answer = 1000000000000 |

93 | Correct | 2 ms | 364 KB | Correct answer: answer = 998762383161 |

94 | Correct | 7 ms | 492 KB | Correct answer: answer = 23017412908 |

95 | Correct | 2 ms | 364 KB | Correct answer: answer = 728143410622 |

96 | Correct | 1 ms | 364 KB | Correct answer: answer = 2 |

97 | Correct | 6 ms | 492 KB | Correct answer: answer = 1824916 |

98 | Correct | 6 ms | 492 KB | Correct answer: answer = 10680029 |

99 | Correct | 6 ms | 492 KB | Correct answer: answer = 18351700 |

100 | Correct | 5 ms | 492 KB | Correct answer: answer = 16040026 |

101 | Correct | 3 ms | 364 KB | Correct answer: answer = 253968628325 |

102 | Correct | 3 ms | 364 KB | Correct answer: answer = 10267 |

103 | Correct | 6 ms | 492 KB | Correct answer: answer = 2582408 |

104 | Correct | 2 ms | 364 KB | Correct answer: answer = 78024964781 |

105 | Correct | 2 ms | 364 KB | Correct answer: answer = 9866346457 |

106 | Correct | 2 ms | 364 KB | Correct answer: answer = 3327720949 |

107 | Correct | 2 ms | 364 KB | Correct answer: answer = 86064128360 |

108 | Correct | 2 ms | 364 KB | Correct answer: answer = 12698259150 |

109 | Correct | 5 ms | 492 KB | Correct answer: answer = 1185259288 |

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

1 | Correct | 1 ms | 512 KB | Correct answer: answer = 4 |

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

3 | Correct | 1 ms | 364 KB | Correct answer: answer = 4 |

4 | Correct | 1 ms | 364 KB | Correct answer: answer = 12 |

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

6 | Correct | 1 ms | 364 KB | Correct answer: answer = 210 |

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

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

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

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

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

12 | Correct | 1 ms | 364 KB | Correct answer: answer = 49 |

13 | Correct | 1 ms | 364 KB | Correct answer: answer = 151 |

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

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

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

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

18 | Correct | 0 ms | 364 KB | Correct answer: answer = 10000 |

19 | Correct | 1 ms | 364 KB | Correct answer: answer = 624 |

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

21 | Correct | 1 ms | 364 KB | Correct answer: answer = 1 |

22 | Correct | 1 ms | 364 KB | Correct answer: answer = 4 |

23 | Correct | 0 ms | 364 KB | Correct answer: answer = 1 |

24 | Correct | 1 ms | 364 KB | Correct answer: answer = 5 |

25 | Correct | 1 ms | 364 KB | Correct answer: answer = 41 |

26 | Correct | 1 ms | 268 KB | Correct answer: answer = 71923 |

27 | Correct | 1 ms | 364 KB | Correct answer: answer = 77137 |

28 | Correct | 1 ms | 364 KB | Correct answer: answer = 764 |

29 | Correct | 1 ms | 364 KB | Correct answer: answer = 250000 |

30 | Correct | 1 ms | 364 KB | Correct answer: answer = 500 |

31 | Correct | 1 ms | 364 KB | Correct answer: answer = 32 |

32 | Correct | 1 ms | 364 KB | Correct answer: answer = 130050 |

33 | Correct | 1 ms | 364 KB | Correct answer: answer = 5110 |

34 | Correct | 1 ms | 364 KB | Correct answer: answer = 2626 |

35 | Correct | 1 ms | 364 KB | Correct answer: answer = 796 |

36 | Correct | 1 ms | 364 KB | Correct answer: answer = 7580 |

37 | Correct | 1 ms | 364 KB | Correct answer: answer = 1904 |

38 | Correct | 1 ms | 364 KB | Correct answer: answer = 996004 |

39 | Correct | 1 ms | 364 KB | Correct answer: answer = 38817 |

40 | Correct | 1 ms | 364 KB | Correct answer: answer = 4096 |

41 | Correct | 1 ms | 364 KB | Correct answer: answer = 1 |

42 | Correct | 1 ms | 364 KB | Correct answer: answer = 1 |

43 | Correct | 1 ms | 364 KB | Correct answer: answer = 2040 |

44 | Correct | 1 ms | 384 KB | Correct answer: answer = 2 |

45 | Correct | 1 ms | 364 KB | Correct answer: answer = 4 |

46 | Correct | 1 ms | 364 KB | Correct answer: answer = 9 |

47 | Correct | 1 ms | 364 KB | Correct answer: answer = 9 |

48 | Correct | 1 ms | 364 KB | Correct answer: answer = 21 |

49 | Correct | 1 ms | 364 KB | Correct answer: answer = 71 |

50 | Correct | 0 ms | 364 KB | Correct answer: answer = 77 |

51 | Correct | 1 ms | 364 KB | Correct answer: answer = 400 |

52 | Correct | 1 ms | 364 KB | Correct answer: answer = 996004 |

53 | Correct | 1 ms | 364 KB | Correct answer: answer = 997310 |

54 | Correct | 1 ms | 364 KB | Correct answer: answer = 990781 |

55 | Correct | 1 ms | 364 KB | Correct answer: answer = 996545 |

56 | Correct | 1 ms | 364 KB | Correct answer: answer = 484 |

57 | Correct | 1 ms | 384 KB | Correct answer: answer = 484 |

58 | Correct | 1 ms | 364 KB | Correct answer: answer = 63501 |

59 | Correct | 1 ms | 364 KB | Correct answer: answer = 323501 |

60 | Correct | 1 ms | 364 KB | Correct answer: answer = 752500 |

61 | Correct | 1 ms | 364 KB | Correct answer: answer = 761480 |

62 | Correct | 1 ms | 364 KB | Correct answer: answer = 758932 |

63 | Correct | 1 ms | 384 KB | Correct answer: answer = 1000000 |

64 | Correct | 1 ms | 364 KB | Correct answer: answer = 750500 |

65 | Correct | 1 ms | 364 KB | Correct answer: answer = 1000000 |

66 | Correct | 1 ms | 364 KB | Correct answer: answer = 250000 |

67 | Correct | 1 ms | 364 KB | Correct answer: answer = 250000 |

68 | Correct | 1 ms | 364 KB | Correct answer: answer = 1000000 |

69 | Correct | 1 ms | 364 KB | Correct answer: answer = 994009 |

70 | Correct | 1 ms | 364 KB | Correct answer: answer = 59315 |

71 | Correct | 1 ms | 364 KB | Correct answer: answer = 25454 |

72 | Correct | 1 ms | 364 KB | Correct answer: answer = 1504 |

73 | Correct | 1 ms | 364 KB | Correct answer: answer = 37486 |

74 | Correct | 1 ms | 364 KB | Correct answer: answer = 4284 |

75 | Correct | 1 ms | 364 KB | Correct answer: answer = 158008 |

76 | Correct | 1 ms | 364 KB | Correct answer: answer = 51860 |

77 | Correct | 1 ms | 364 KB | Correct answer: answer = 12985 |

78 | Correct | 2 ms | 364 KB | Correct answer: answer = 997864126212 |

79 | Correct | 2 ms | 364 KB | Correct answer: answer = 998608411647 |

80 | Correct | 2 ms | 364 KB | Correct answer: answer = 995265560477 |

81 | Correct | 6 ms | 492 KB | Correct answer: answer = 10125000 |

82 | Correct | 5 ms | 492 KB | Correct answer: answer = 2291668 |

83 | Correct | 4 ms | 364 KB | Correct answer: answer = 42388 |

84 | Correct | 3 ms | 364 KB | Correct answer: answer = 10318 |

85 | Correct | 2 ms | 364 KB | Correct answer: answer = 3416 |

86 | Correct | 9 ms | 492 KB | Correct answer: answer = 331708193881 |

87 | Correct | 8 ms | 492 KB | Correct answer: answer = 2861193756 |

88 | Correct | 7 ms | 492 KB | Correct answer: answer = 114646930 |

89 | Correct | 5 ms | 492 KB | Correct answer: answer = 9280921 |

90 | Correct | 6 ms | 492 KB | Correct answer: answer = 999984053400 |

91 | Correct | 7 ms | 492 KB | Correct answer: answer = 750935949134 |

92 | Correct | 2 ms | 364 KB | Correct answer: answer = 1000000000000 |

93 | Correct | 2 ms | 364 KB | Correct answer: answer = 998762383161 |

94 | Correct | 7 ms | 492 KB | Correct answer: answer = 23017412908 |

95 | Correct | 2 ms | 364 KB | Correct answer: answer = 728143410622 |

96 | Correct | 1 ms | 364 KB | Correct answer: answer = 2 |

97 | Correct | 6 ms | 492 KB | Correct answer: answer = 1824916 |

98 | Correct | 6 ms | 492 KB | Correct answer: answer = 10680029 |

99 | Correct | 6 ms | 492 KB | Correct answer: answer = 18351700 |

100 | Correct | 5 ms | 492 KB | Correct answer: answer = 16040026 |

101 | Correct | 3 ms | 364 KB | Correct answer: answer = 253968628325 |

102 | Correct | 3 ms | 364 KB | Correct answer: answer = 10267 |

103 | Correct | 6 ms | 492 KB | Correct answer: answer = 2582408 |

104 | Correct | 2 ms | 364 KB | Correct answer: answer = 78024964781 |

105 | Correct | 2 ms | 364 KB | Correct answer: answer = 9866346457 |

106 | Correct | 2 ms | 364 KB | Correct answer: answer = 3327720949 |

107 | Correct | 2 ms | 364 KB | Correct answer: answer = 86064128360 |

108 | Correct | 2 ms | 364 KB | Correct answer: answer = 12698259150 |

109 | Correct | 5 ms | 492 KB | Correct answer: answer = 1185259288 |

110 | Correct | 18 ms | 1260 KB | Correct answer: answer = 999889968863 |

111 | Correct | 18 ms | 1388 KB | Correct answer: answer = 999861384931 |

112 | Correct | 22 ms | 1260 KB | Correct answer: answer = 999811809929 |

113 | Correct | 18 ms | 1260 KB | Correct answer: answer = 999869756441 |

114 | Correct | 61 ms | 2200 KB | Correct answer: answer = 1700000000 |

115 | Correct | 64 ms | 2200 KB | Correct answer: answer = 131666670 |

116 | Correct | 17 ms | 1128 KB | Correct answer: answer = 89478486 |

117 | Correct | 19 ms | 1004 KB | Correct answer: answer = 4971040 |

118 | Correct | 18 ms | 1004 KB | Correct answer: answer = 2711494 |

119 | Correct | 63 ms | 2336 KB | Correct answer: answer = 25252530 |

120 | Correct | 59 ms | 2336 KB | Correct answer: answer = 62500000 |

121 | Correct | 89 ms | 1952 KB | Correct answer: answer = 333175097780 |

122 | Correct | 93 ms | 1952 KB | Correct answer: answer = 33121180179 |

123 | Correct | 89 ms | 1952 KB | Correct answer: answer = 9802314015 |

124 | Correct | 63 ms | 2336 KB | Correct answer: answer = 32567551 |

125 | Correct | 71 ms | 2200 KB | Correct answer: answer = 997525000000 |

126 | Correct | 81 ms | 1952 KB | Correct answer: answer = 752723538884 |

127 | Correct | 13 ms | 1260 KB | Correct answer: answer = 1000000000000 |

128 | Correct | 17 ms | 1260 KB | Correct answer: answer = 999978000121 |

129 | Correct | 18 ms | 1260 KB | Correct answer: answer = 745986144735 |

130 | Correct | 11 ms | 1260 KB | Correct answer: answer = 2 |

131 | Correct | 83 ms | 2200 KB | Correct answer: answer = 277966670 |

132 | Correct | 69 ms | 2328 KB | Correct answer: answer = 2500900082 |

133 | Correct | 26 ms | 1388 KB | Correct answer: answer = 301248349636 |

134 | Correct | 47 ms | 1384 KB | Correct answer: answer = 14118891 |

135 | Correct | 19 ms | 1260 KB | Correct answer: answer = 14384977265 |

136 | Correct | 34 ms | 1260 KB | Correct answer: answer = 3681368330 |

137 | Correct | 26 ms | 1260 KB | Correct answer: answer = 2720316816 |

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

1 | Correct | 1 ms | 512 KB | Correct answer: answer = 4 |

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

3 | Correct | 1 ms | 364 KB | Correct answer: answer = 4 |

4 | Correct | 1 ms | 364 KB | Correct answer: answer = 12 |

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

6 | Correct | 1 ms | 364 KB | Correct answer: answer = 210 |

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

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

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

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

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

12 | Correct | 1 ms | 364 KB | Correct answer: answer = 49 |

13 | Correct | 1 ms | 364 KB | Correct answer: answer = 151 |

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

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

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

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

18 | Correct | 0 ms | 364 KB | Correct answer: answer = 10000 |

19 | Correct | 1 ms | 364 KB | Correct answer: answer = 624 |

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

21 | Correct | 1 ms | 364 KB | Correct answer: answer = 1 |

22 | Correct | 1 ms | 364 KB | Correct answer: answer = 4 |

23 | Correct | 0 ms | 364 KB | Correct answer: answer = 1 |

24 | Correct | 1 ms | 364 KB | Correct answer: answer = 5 |

25 | Correct | 1 ms | 364 KB | Correct answer: answer = 41 |

26 | Correct | 1 ms | 268 KB | Correct answer: answer = 71923 |

27 | Correct | 1 ms | 364 KB | Correct answer: answer = 77137 |

28 | Correct | 1 ms | 364 KB | Correct answer: answer = 764 |

29 | Correct | 1 ms | 364 KB | Correct answer: answer = 250000 |

30 | Correct | 1 ms | 364 KB | Correct answer: answer = 500 |

31 | Correct | 1 ms | 364 KB | Correct answer: answer = 32 |

32 | Correct | 1 ms | 364 KB | Correct answer: answer = 130050 |

33 | Correct | 1 ms | 364 KB | Correct answer: answer = 5110 |

34 | Correct | 1 ms | 364 KB | Correct answer: answer = 2626 |

35 | Correct | 1 ms | 364 KB | Correct answer: answer = 796 |

36 | Correct | 1 ms | 364 KB | Correct answer: answer = 7580 |

37 | Correct | 1 ms | 364 KB | Correct answer: answer = 1904 |

38 | Correct | 1 ms | 364 KB | Correct answer: answer = 996004 |

39 | Correct | 1 ms | 364 KB | Correct answer: answer = 38817 |

40 | Correct | 1 ms | 364 KB | Correct answer: answer = 4096 |

41 | Correct | 1 ms | 364 KB | Correct answer: answer = 1 |

42 | Correct | 1 ms | 364 KB | Correct answer: answer = 1 |

43 | Correct | 1 ms | 364 KB | Correct answer: answer = 2040 |

44 | Correct | 1 ms | 384 KB | Correct answer: answer = 2 |

45 | Correct | 1 ms | 364 KB | Correct answer: answer = 4 |

46 | Correct | 1 ms | 364 KB | Correct answer: answer = 9 |

47 | Correct | 1 ms | 364 KB | Correct answer: answer = 9 |

48 | Correct | 1 ms | 364 KB | Correct answer: answer = 21 |

49 | Correct | 1 ms | 364 KB | Correct answer: answer = 71 |

50 | Correct | 0 ms | 364 KB | Correct answer: answer = 77 |

51 | Correct | 1 ms | 364 KB | Correct answer: answer = 400 |

52 | Correct | 1 ms | 364 KB | Correct answer: answer = 996004 |

53 | Correct | 1 ms | 364 KB | Correct answer: answer = 997310 |

54 | Correct | 1 ms | 364 KB | Correct answer: answer = 990781 |

55 | Correct | 1 ms | 364 KB | Correct answer: answer = 996545 |

56 | Correct | 1 ms | 364 KB | Correct answer: answer = 484 |

57 | Correct | 1 ms | 384 KB | Correct answer: answer = 484 |

58 | Correct | 1 ms | 364 KB | Correct answer: answer = 63501 |

59 | Correct | 1 ms | 364 KB | Correct answer: answer = 323501 |

60 | Correct | 1 ms | 364 KB | Correct answer: answer = 752500 |

61 | Correct | 1 ms | 364 KB | Correct answer: answer = 761480 |

62 | Correct | 1 ms | 364 KB | Correct answer: answer = 758932 |

63 | Correct | 1 ms | 384 KB | Correct answer: answer = 1000000 |

64 | Correct | 1 ms | 364 KB | Correct answer: answer = 750500 |

65 | Correct | 1 ms | 364 KB | Correct answer: answer = 1000000 |

66 | Correct | 1 ms | 364 KB | Correct answer: answer = 250000 |

67 | Correct | 1 ms | 364 KB | Correct answer: answer = 250000 |

68 | Correct | 1 ms | 364 KB | Correct answer: answer = 1000000 |

69 | Correct | 1 ms | 364 KB | Correct answer: answer = 994009 |

70 | Correct | 1 ms | 364 KB | Correct answer: answer = 59315 |

71 | Correct | 1 ms | 364 KB | Correct answer: answer = 25454 |

72 | Correct | 1 ms | 364 KB | Correct answer: answer = 1504 |

73 | Correct | 1 ms | 364 KB | Correct answer: answer = 37486 |

74 | Correct | 1 ms | 364 KB | Correct answer: answer = 4284 |

75 | Correct | 1 ms | 364 KB | Correct answer: answer = 158008 |

76 | Correct | 1 ms | 364 KB | Correct answer: answer = 51860 |

77 | Correct | 1 ms | 364 KB | Correct answer: answer = 12985 |

78 | Correct | 2 ms | 364 KB | Correct answer: answer = 997864126212 |

79 | Correct | 2 ms | 364 KB | Correct answer: answer = 998608411647 |

80 | Correct | 2 ms | 364 KB | Correct answer: answer = 995265560477 |

81 | Correct | 6 ms | 492 KB | Correct answer: answer = 10125000 |

82 | Correct | 5 ms | 492 KB | Correct answer: answer = 2291668 |

83 | Correct | 4 ms | 364 KB | Correct answer: answer = 42388 |

84 | Correct | 3 ms | 364 KB | Correct answer: answer = 10318 |

85 | Correct | 2 ms | 364 KB | Correct answer: answer = 3416 |

86 | Correct | 9 ms | 492 KB | Correct answer: answer = 331708193881 |

87 | Correct | 8 ms | 492 KB | Correct answer: answer = 2861193756 |

88 | Correct | 7 ms | 492 KB | Correct answer: answer = 114646930 |

89 | Correct | 5 ms | 492 KB | Correct answer: answer = 9280921 |

90 | Correct | 6 ms | 492 KB | Correct answer: answer = 999984053400 |

91 | Correct | 7 ms | 492 KB | Correct answer: answer = 750935949134 |

92 | Correct | 2 ms | 364 KB | Correct answer: answer = 1000000000000 |

93 | Correct | 2 ms | 364 KB | Correct answer: answer = 998762383161 |

94 | Correct | 7 ms | 492 KB | Correct answer: answer = 23017412908 |

95 | Correct | 2 ms | 364 KB | Correct answer: answer = 728143410622 |

96 | Correct | 1 ms | 364 KB | Correct answer: answer = 2 |

97 | Correct | 6 ms | 492 KB | Correct answer: answer = 1824916 |

98 | Correct | 6 ms | 492 KB | Correct answer: answer = 10680029 |

99 | Correct | 6 ms | 492 KB | Correct answer: answer = 18351700 |

100 | Correct | 5 ms | 492 KB | Correct answer: answer = 16040026 |

101 | Correct | 3 ms | 364 KB | Correct answer: answer = 253968628325 |

102 | Correct | 3 ms | 364 KB | Correct answer: answer = 10267 |

103 | Correct | 6 ms | 492 KB | Correct answer: answer = 2582408 |

104 | Correct | 2 ms | 364 KB | Correct answer: answer = 78024964781 |

105 | Correct | 2 ms | 364 KB | Correct answer: answer = 9866346457 |

106 | Correct | 2 ms | 364 KB | Correct answer: answer = 3327720949 |

107 | Correct | 2 ms | 364 KB | Correct answer: answer = 86064128360 |

108 | Correct | 2 ms | 364 KB | Correct answer: answer = 12698259150 |

109 | Correct | 5 ms | 492 KB | Correct answer: answer = 1185259288 |

110 | Correct | 18 ms | 1260 KB | Correct answer: answer = 999889968863 |

111 | Correct | 18 ms | 1388 KB | Correct answer: answer = 999861384931 |

112 | Correct | 22 ms | 1260 KB | Correct answer: answer = 999811809929 |

113 | Correct | 18 ms | 1260 KB | Correct answer: answer = 999869756441 |

114 | Correct | 61 ms | 2200 KB | Correct answer: answer = 1700000000 |

115 | Correct | 64 ms | 2200 KB | Correct answer: answer = 131666670 |

116 | Correct | 17 ms | 1128 KB | Correct answer: answer = 89478486 |

117 | Correct | 19 ms | 1004 KB | Correct answer: answer = 4971040 |

118 | Correct | 18 ms | 1004 KB | Correct answer: answer = 2711494 |

119 | Correct | 63 ms | 2336 KB | Correct answer: answer = 25252530 |

120 | Correct | 59 ms | 2336 KB | Correct answer: answer = 62500000 |

121 | Correct | 89 ms | 1952 KB | Correct answer: answer = 333175097780 |

122 | Correct | 93 ms | 1952 KB | Correct answer: answer = 33121180179 |

123 | Correct | 89 ms | 1952 KB | Correct answer: answer = 9802314015 |

124 | Correct | 63 ms | 2336 KB | Correct answer: answer = 32567551 |

125 | Correct | 71 ms | 2200 KB | Correct answer: answer = 997525000000 |

126 | Correct | 81 ms | 1952 KB | Correct answer: answer = 752723538884 |

127 | Correct | 13 ms | 1260 KB | Correct answer: answer = 1000000000000 |

128 | Correct | 17 ms | 1260 KB | Correct answer: answer = 999978000121 |

129 | Correct | 18 ms | 1260 KB | Correct answer: answer = 745986144735 |

130 | Correct | 11 ms | 1260 KB | Correct answer: answer = 2 |

131 | Correct | 83 ms | 2200 KB | Correct answer: answer = 277966670 |

132 | Correct | 69 ms | 2328 KB | Correct answer: answer = 2500900082 |

133 | Correct | 26 ms | 1388 KB | Correct answer: answer = 301248349636 |

134 | Correct | 47 ms | 1384 KB | Correct answer: answer = 14118891 |

135 | Correct | 19 ms | 1260 KB | Correct answer: answer = 14384977265 |

136 | Correct | 34 ms | 1260 KB | Correct answer: answer = 3681368330 |

137 | Correct | 26 ms | 1260 KB | Correct answer: answer = 2720316816 |

138 | Correct | 41 ms | 2284 KB | Correct answer: answer = 999976000144 |

139 | Correct | 37 ms | 2412 KB | Correct answer: answer = 999856102410 |

140 | Correct | 45 ms | 2304 KB | Correct answer: answer = 999958401531 |

141 | Correct | 37 ms | 2284 KB | Correct answer: answer = 999769649944 |

142 | Correct | 46 ms | 2284 KB | Correct answer: answer = 999874525918 |

143 | Correct | 130 ms | 4056 KB | Correct answer: answer = 6050000000 |

144 | Correct | 137 ms | 4056 KB | Correct answer: answer = 1112500000 |

145 | Correct | 67 ms | 3040 KB | Correct answer: answer = 4294967296 |

146 | Correct | 120 ms | 2912 KB | Correct answer: answer = 87652406 |

147 | Correct | 92 ms | 3072 KB | Correct answer: answer = 6297664 |

148 | Correct | 75 ms | 2912 KB | Correct answer: answer = 196612 |

149 | Correct | 130 ms | 5464 KB | Correct answer: answer = 15015100 |

150 | Correct | 125 ms | 5464 KB | Correct answer: answer = 25000000 |

151 | Correct | 176 ms | 4840 KB | Correct answer: answer = 333230209550 |

152 | Correct | 178 ms | 4836 KB | Correct answer: answer = 917123769 |

153 | Correct | 172 ms | 4836 KB | Correct answer: answer = 95162 |

154 | Correct | 130 ms | 5464 KB | Correct answer: answer = 382616191 |

155 | Correct | 141 ms | 5448 KB | Correct answer: answer = 990033333400 |

156 | Correct | 144 ms | 5448 KB | Correct answer: answer = 990000100000 |

157 | Correct | 148 ms | 4836 KB | Correct answer: answer = 749998188180 |

158 | Correct | 28 ms | 3692 KB | Correct answer: answer = 1000000000000 |

159 | Correct | 37 ms | 3564 KB | Correct answer: answer = 999988000036 |

160 | Correct | 38 ms | 3564 KB | Correct answer: answer = 744929274393 |

161 | Correct | 22 ms | 2668 KB | Correct answer: answer = 2 |

162 | Correct | 139 ms | 5448 KB | Correct answer: answer = 1300024 |

163 | Correct | 141 ms | 5320 KB | Correct answer: answer = 5000700010 |

164 | Correct | 52 ms | 3692 KB | Correct answer: answer = 354997100800 |

165 | Correct | 77 ms | 2720 KB | Correct answer: answer = 257000 |

166 | Correct | 79 ms | 3104 KB | Correct answer: answer = 3765323 |

167 | Correct | 80 ms | 2968 KB | Correct answer: answer = 1525903 |

168 | Correct | 39 ms | 3692 KB | Correct answer: answer = 67618137730 |

169 | Correct | 39 ms | 3820 KB | Correct answer: answer = 12656680171 |

170 | Correct | 42 ms | 3692 KB | Correct answer: answer = 579831736 |

171 | Correct | 75 ms | 4076 KB | Correct answer: answer = 23605611 |

172 | Correct | 42 ms | 3696 KB | Correct answer: answer = 7052481200 |

173 | Correct | 50 ms | 3820 KB | Correct answer: answer = 1314039500 |

174 | Correct | 60 ms | 4076 KB | Correct answer: answer = 302484000 |

175 | Correct | 103 ms | 4316 KB | Correct answer: answer = 52348480 |