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

347988 | 2021-01-14T02:16:25 Z | juggernaut | Aliens (IOI16_aliens) | C++14 | 885 ms | 126316 KB |

#include"aliens.h" #include<bits/stdc++.h> #ifdef EVAL #else #include"grader.cpp" #endif using namespace std; typedef long long ll; vector<vector<ll>>dp; pair<ll,ll>a[50005],b[50005]; bool cmp(pair<ll,ll>l,pair<ll,ll>r){ if(l.first==r.first)return l.second>r.second; return l.first<r.first; } ll sq(ll a){ return a*a; } ll cost(ll l, ll r){ return sq(max(0ll,b[r].second-b[l].first+1))-sq(max(0ll,b[l-1].second-b[l].first+1)); } void divide(int l,int r,int optl,int optr,int k){ if(l>r)return; int mid=(l+r)>>1,opt=0; for(int i=optl;i<=optr;i++) if(dp[mid][k]>dp[i-1][k-1]+cost(i,mid)){ dp[mid][k]=dp[i-1][k-1]+cost(i,mid); opt=i; } divide(l,mid-1,optl,opt,k); divide(mid+1,r,opt,optr,k); } ll take_photos(int n,int m,int k,vector<int>r,vector<int>c){ dp.assign(n+5,vector<ll>(k+5,1e15)); dp[0][0]=0; for(int i=0;i<n;i++)a[i+1]={min(r[i],c[i])+1,max(r[i],c[i])+1}; sort(a+1,a+1+n,cmp); ll last=0,pos=0; for(int i=1;i<=n;i++) if(a[i].second>last){ last=a[i].second; b[++pos]=a[i]; } n=pos; for(int i=1;i<=n;i++)dp[i][1]=cost(1,i); for(int i=2;i<=k;i++)divide(1,n,1,n,i); ll res=1e15; for(int i=1;i<=k;i++)res=min(res,dp[n][i]); return res; }

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

1 | Correct | 1 ms | 364 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 | 236 KB | Correct answer: answer = 12 |

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

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

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

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

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

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

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

12 | Correct | 1 ms | 384 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 | 1 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 | 1 ms | 364 KB | Correct answer: answer = 1 |

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

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

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

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

8 | Correct | 7 ms | 1388 KB | Correct answer: answer = 764 |

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

10 | Correct | 15 ms | 2412 KB | Correct answer: answer = 500 |

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

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

13 | Correct | 2 ms | 620 KB | Correct answer: answer = 5110 |

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

15 | Correct | 2 ms | 492 KB | Correct answer: answer = 796 |

16 | Correct | 2 ms | 492 KB | Correct answer: answer = 7580 |

17 | Correct | 5 ms | 876 KB | Correct answer: answer = 1904 |

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

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

20 | Correct | 3 ms | 748 KB | Correct answer: answer = 4096 |

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

22 | Correct | 2 ms | 2412 KB | Correct answer: answer = 1 |

23 | Correct | 4 ms | 876 KB | Correct answer: answer = 2040 |

24 | Correct | 2 ms | 2412 KB | Correct answer: answer = 2 |

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

1 | Correct | 1 ms | 364 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 | 236 KB | Correct answer: answer = 12 |

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

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

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

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

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

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

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

12 | Correct | 1 ms | 384 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 | 1 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 | 1 ms | 364 KB | Correct answer: answer = 1 |

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

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

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

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

28 | Correct | 7 ms | 1388 KB | Correct answer: answer = 764 |

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

30 | Correct | 15 ms | 2412 KB | Correct answer: answer = 500 |

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

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

33 | Correct | 2 ms | 620 KB | Correct answer: answer = 5110 |

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

35 | Correct | 2 ms | 492 KB | Correct answer: answer = 796 |

36 | Correct | 2 ms | 492 KB | Correct answer: answer = 7580 |

37 | Correct | 5 ms | 876 KB | Correct answer: answer = 1904 |

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

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

40 | Correct | 3 ms | 748 KB | Correct answer: answer = 4096 |

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

42 | Correct | 2 ms | 2412 KB | Correct answer: answer = 1 |

43 | Correct | 4 ms | 876 KB | Correct answer: answer = 2040 |

44 | Correct | 2 ms | 2412 KB | Correct answer: answer = 2 |

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

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

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

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

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

50 | Correct | 1 ms | 384 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 | 876 KB | Correct answer: answer = 990781 |

55 | Correct | 2 ms | 2412 KB | Correct answer: answer = 996545 |

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

57 | Correct | 2 ms | 2284 KB | Correct answer: answer = 484 |

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

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

60 | Correct | 3 ms | 768 KB | Correct answer: answer = 752500 |

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

62 | Correct | 4 ms | 1132 KB | Correct answer: answer = 758932 |

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

64 | Correct | 15 ms | 2412 KB | Correct answer: answer = 750500 |

65 | Correct | 2 ms | 2412 KB | Correct answer: answer = 1000000 |

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

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

68 | Correct | 2 ms | 2412 KB | Correct answer: answer = 1000000 |

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

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

71 | Correct | 2 ms | 748 KB | Correct answer: answer = 25454 |

72 | Correct | 3 ms | 748 KB | Correct answer: answer = 1504 |

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

74 | Correct | 2 ms | 620 KB | Correct answer: answer = 4284 |

75 | Correct | 2 ms | 2028 KB | Correct answer: answer = 158008 |

76 | Correct | 2 ms | 1004 KB | Correct answer: answer = 51860 |

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

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

1 | Correct | 1 ms | 364 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 | 236 KB | Correct answer: answer = 12 |

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

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

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

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

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

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

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

12 | Correct | 1 ms | 384 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 | 1 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 | 1 ms | 364 KB | Correct answer: answer = 1 |

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

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

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

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

28 | Correct | 7 ms | 1388 KB | Correct answer: answer = 764 |

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

30 | Correct | 15 ms | 2412 KB | Correct answer: answer = 500 |

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

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

33 | Correct | 2 ms | 620 KB | Correct answer: answer = 5110 |

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

35 | Correct | 2 ms | 492 KB | Correct answer: answer = 796 |

36 | Correct | 2 ms | 492 KB | Correct answer: answer = 7580 |

37 | Correct | 5 ms | 876 KB | Correct answer: answer = 1904 |

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

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

40 | Correct | 3 ms | 748 KB | Correct answer: answer = 4096 |

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

42 | Correct | 2 ms | 2412 KB | Correct answer: answer = 1 |

43 | Correct | 4 ms | 876 KB | Correct answer: answer = 2040 |

44 | Correct | 2 ms | 2412 KB | Correct answer: answer = 2 |

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

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

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

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

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

50 | Correct | 1 ms | 384 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 | 876 KB | Correct answer: answer = 990781 |

55 | Correct | 2 ms | 2412 KB | Correct answer: answer = 996545 |

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

57 | Correct | 2 ms | 2284 KB | Correct answer: answer = 484 |

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

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

60 | Correct | 3 ms | 768 KB | Correct answer: answer = 752500 |

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

62 | Correct | 4 ms | 1132 KB | Correct answer: answer = 758932 |

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

64 | Correct | 15 ms | 2412 KB | Correct answer: answer = 750500 |

65 | Correct | 2 ms | 2412 KB | Correct answer: answer = 1000000 |

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

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

68 | Correct | 2 ms | 2412 KB | Correct answer: answer = 1000000 |

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

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

71 | Correct | 2 ms | 748 KB | Correct answer: answer = 25454 |

72 | Correct | 3 ms | 748 KB | Correct answer: answer = 1504 |

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

74 | Correct | 2 ms | 620 KB | Correct answer: answer = 4284 |

75 | Correct | 2 ms | 2028 KB | Correct answer: answer = 158008 |

76 | Correct | 2 ms | 1004 KB | Correct answer: answer = 51860 |

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

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

79 | Correct | 6 ms | 7020 KB | Correct answer: answer = 998608411647 |

80 | Correct | 52 ms | 94828 KB | Correct answer: answer = 995265560477 |

81 | Correct | 3 ms | 896 KB | Correct answer: answer = 10125000 |

82 | Correct | 4 ms | 1132 KB | Correct answer: answer = 2291668 |

83 | Correct | 14 ms | 2156 KB | Correct answer: answer = 42388 |

84 | Correct | 68 ms | 7148 KB | Correct answer: answer = 10318 |

85 | Correct | 259 ms | 22508 KB | Correct answer: answer = 3416 |

86 | Correct | 3 ms | 1004 KB | Correct answer: answer = 331708193881 |

87 | Correct | 86 ms | 8172 KB | Correct answer: answer = 2861193756 |

88 | Correct | 639 ms | 42732 KB | Correct answer: answer = 114646930 |

89 | Correct | 17 ms | 2540 KB | Correct answer: answer = 9280921 |

90 | Correct | 99 ms | 10348 KB | Correct answer: answer = 999984053400 |

91 | Correct | 455 ms | 32364 KB | Correct answer: answer = 750935949134 |

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

93 | Correct | 64 ms | 126316 KB | Correct answer: answer = 998762383161 |

94 | Correct | 14 ms | 2156 KB | Correct answer: answer = 23017412908 |

95 | Correct | 22 ms | 32108 KB | Correct answer: answer = 728143410622 |

96 | Correct | 2 ms | 748 KB | Correct answer: answer = 2 |

97 | Correct | 5 ms | 1132 KB | Correct answer: answer = 1824916 |

98 | Correct | 204 ms | 17004 KB | Correct answer: answer = 10680029 |

99 | Correct | 89 ms | 8812 KB | Correct answer: answer = 18351700 |

100 | Correct | 3 ms | 876 KB | Correct answer: answer = 16040026 |

101 | Correct | 2 ms | 876 KB | Correct answer: answer = 253968628325 |

102 | Correct | 197 ms | 16236 KB | Correct answer: answer = 10267 |

103 | Correct | 797 ms | 56044 KB | Correct answer: answer = 2582408 |

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

105 | Correct | 3 ms | 1132 KB | Correct answer: answer = 9866346457 |

106 | Correct | 7 ms | 3948 KB | Correct answer: answer = 3327720949 |

107 | Correct | 55 ms | 57964 KB | Correct answer: answer = 86064128360 |

108 | Correct | 185 ms | 92396 KB | Correct answer: answer = 12698259150 |

109 | Correct | 885 ms | 78828 KB | Correct answer: answer = 1185259288 |

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

1 | Correct | 1 ms | 364 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 | 236 KB | Correct answer: answer = 12 |

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

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

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

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

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

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

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

12 | Correct | 1 ms | 384 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 | 1 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 | 1 ms | 364 KB | Correct answer: answer = 1 |

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

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

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

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

28 | Correct | 7 ms | 1388 KB | Correct answer: answer = 764 |

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

30 | Correct | 15 ms | 2412 KB | Correct answer: answer = 500 |

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

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

33 | Correct | 2 ms | 620 KB | Correct answer: answer = 5110 |

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

35 | Correct | 2 ms | 492 KB | Correct answer: answer = 796 |

36 | Correct | 2 ms | 492 KB | Correct answer: answer = 7580 |

37 | Correct | 5 ms | 876 KB | Correct answer: answer = 1904 |

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

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

40 | Correct | 3 ms | 748 KB | Correct answer: answer = 4096 |

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

42 | Correct | 2 ms | 2412 KB | Correct answer: answer = 1 |

43 | Correct | 4 ms | 876 KB | Correct answer: answer = 2040 |

44 | Correct | 2 ms | 2412 KB | Correct answer: answer = 2 |

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

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

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

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

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

50 | Correct | 1 ms | 384 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 | 876 KB | Correct answer: answer = 990781 |

55 | Correct | 2 ms | 2412 KB | Correct answer: answer = 996545 |

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

57 | Correct | 2 ms | 2284 KB | Correct answer: answer = 484 |

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

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

60 | Correct | 3 ms | 768 KB | Correct answer: answer = 752500 |

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

62 | Correct | 4 ms | 1132 KB | Correct answer: answer = 758932 |

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

64 | Correct | 15 ms | 2412 KB | Correct answer: answer = 750500 |

65 | Correct | 2 ms | 2412 KB | Correct answer: answer = 1000000 |

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

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

68 | Correct | 2 ms | 2412 KB | Correct answer: answer = 1000000 |

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

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

71 | Correct | 2 ms | 748 KB | Correct answer: answer = 25454 |

72 | Correct | 3 ms | 748 KB | Correct answer: answer = 1504 |

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

74 | Correct | 2 ms | 620 KB | Correct answer: answer = 4284 |

75 | Correct | 2 ms | 2028 KB | Correct answer: answer = 158008 |

76 | Correct | 2 ms | 1004 KB | Correct answer: answer = 51860 |

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

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

79 | Correct | 6 ms | 7020 KB | Correct answer: answer = 998608411647 |

80 | Correct | 52 ms | 94828 KB | Correct answer: answer = 995265560477 |

81 | Correct | 3 ms | 896 KB | Correct answer: answer = 10125000 |

82 | Correct | 4 ms | 1132 KB | Correct answer: answer = 2291668 |

83 | Correct | 14 ms | 2156 KB | Correct answer: answer = 42388 |

84 | Correct | 68 ms | 7148 KB | Correct answer: answer = 10318 |

85 | Correct | 259 ms | 22508 KB | Correct answer: answer = 3416 |

86 | Correct | 3 ms | 1004 KB | Correct answer: answer = 331708193881 |

87 | Correct | 86 ms | 8172 KB | Correct answer: answer = 2861193756 |

88 | Correct | 639 ms | 42732 KB | Correct answer: answer = 114646930 |

89 | Correct | 17 ms | 2540 KB | Correct answer: answer = 9280921 |

90 | Correct | 99 ms | 10348 KB | Correct answer: answer = 999984053400 |

91 | Correct | 455 ms | 32364 KB | Correct answer: answer = 750935949134 |

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

93 | Correct | 64 ms | 126316 KB | Correct answer: answer = 998762383161 |

94 | Correct | 14 ms | 2156 KB | Correct answer: answer = 23017412908 |

95 | Correct | 22 ms | 32108 KB | Correct answer: answer = 728143410622 |

96 | Correct | 2 ms | 748 KB | Correct answer: answer = 2 |

97 | Correct | 5 ms | 1132 KB | Correct answer: answer = 1824916 |

98 | Correct | 204 ms | 17004 KB | Correct answer: answer = 10680029 |

99 | Correct | 89 ms | 8812 KB | Correct answer: answer = 18351700 |

100 | Correct | 3 ms | 876 KB | Correct answer: answer = 16040026 |

101 | Correct | 2 ms | 876 KB | Correct answer: answer = 253968628325 |

102 | Correct | 197 ms | 16236 KB | Correct answer: answer = 10267 |

103 | Correct | 797 ms | 56044 KB | Correct answer: answer = 2582408 |

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

105 | Correct | 3 ms | 1132 KB | Correct answer: answer = 9866346457 |

106 | Correct | 7 ms | 3948 KB | Correct answer: answer = 3327720949 |

107 | Correct | 55 ms | 57964 KB | Correct answer: answer = 86064128360 |

108 | Correct | 185 ms | 92396 KB | Correct answer: answer = 12698259150 |

109 | Correct | 885 ms | 78828 KB | Correct answer: answer = 1185259288 |

110 | Correct | 24 ms | 7660 KB | Correct answer: answer = 999889968863 |

111 | Correct | 24 ms | 9196 KB | Correct answer: answer = 999861384931 |

112 | Correct | 34 ms | 25708 KB | Correct answer: answer = 999811809929 |

113 | Correct | 43 ms | 45164 KB | Correct answer: answer = 999869756441 |

114 | Correct | 29 ms | 7532 KB | Correct answer: answer = 1700000000 |

115 | Correct | 120 ms | 14572 KB | Correct answer: answer = 131666670 |

116 | Correct | 9 ms | 2924 KB | Correct answer: answer = 89478486 |

117 | Correct | 86 ms | 9324 KB | Correct answer: answer = 4971040 |

118 | Correct | 156 ms | 15212 KB | Correct answer: answer = 2711494 |

119 | Correct | 678 ms | 46060 KB | Correct answer: answer = 25252530 |

120 | Correct | 259 ms | 22508 KB | Correct answer: answer = 62500000 |

121 | Correct | 33 ms | 8428 KB | Correct answer: answer = 333175097780 |

122 | Correct | 195 ms | 18540 KB | Correct answer: answer = 33121180179 |

123 | Correct | 694 ms | 46060 KB | Correct answer: answer = 9802314015 |

124 | Correct | 520 ms | 37228 KB | Correct answer: answer = 32567551 |

125 | Correct | 694 ms | 46060 KB | Correct answer: answer = 997525000000 |

126 | Correct | 610 ms | 45932 KB | Correct answer: answer = 752723538884 |

127 | Correct | 19 ms | 6764 KB | Correct answer: answer = 1000000000000 |

128 | Correct | 43 ms | 45164 KB | Correct answer: answer = 999978000121 |

129 | Correct | 44 ms | 45420 KB | Correct answer: answer = 745986144735 |

130 | Correct | 17 ms | 6380 KB | Correct answer: answer = 2 |

131 | Correct | 75 ms | 10604 KB | Correct answer: answer = 277966670 |

132 | Correct | 27 ms | 7532 KB | Correct answer: answer = 2500900082 |

133 | Correct | 23 ms | 6892 KB | Correct answer: answer = 301248349636 |

134 | Correct | 336 ms | 23276 KB | Correct answer: answer = 14118891 |

135 | Correct | 24 ms | 7660 KB | Correct answer: answer = 14384977265 |

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

137 | Correct | 48 ms | 45292 KB | Correct answer: answer = 2720316816 |

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

1 | Correct | 1 ms | 364 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 | 236 KB | Correct answer: answer = 12 |

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

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

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

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

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

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

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

12 | Correct | 1 ms | 384 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 | 1 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 | 1 ms | 364 KB | Correct answer: answer = 1 |

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

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

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

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

28 | Correct | 7 ms | 1388 KB | Correct answer: answer = 764 |

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

30 | Correct | 15 ms | 2412 KB | Correct answer: answer = 500 |

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

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

33 | Correct | 2 ms | 620 KB | Correct answer: answer = 5110 |

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

35 | Correct | 2 ms | 492 KB | Correct answer: answer = 796 |

36 | Correct | 2 ms | 492 KB | Correct answer: answer = 7580 |

37 | Correct | 5 ms | 876 KB | Correct answer: answer = 1904 |

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

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

40 | Correct | 3 ms | 748 KB | Correct answer: answer = 4096 |

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

42 | Correct | 2 ms | 2412 KB | Correct answer: answer = 1 |

43 | Correct | 4 ms | 876 KB | Correct answer: answer = 2040 |

44 | Correct | 2 ms | 2412 KB | Correct answer: answer = 2 |

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

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

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

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

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

50 | Correct | 1 ms | 384 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 | 876 KB | Correct answer: answer = 990781 |

55 | Correct | 2 ms | 2412 KB | Correct answer: answer = 996545 |

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

57 | Correct | 2 ms | 2284 KB | Correct answer: answer = 484 |

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

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

60 | Correct | 3 ms | 768 KB | Correct answer: answer = 752500 |

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

62 | Correct | 4 ms | 1132 KB | Correct answer: answer = 758932 |

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

64 | Correct | 15 ms | 2412 KB | Correct answer: answer = 750500 |

65 | Correct | 2 ms | 2412 KB | Correct answer: answer = 1000000 |

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

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

68 | Correct | 2 ms | 2412 KB | Correct answer: answer = 1000000 |

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

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

71 | Correct | 2 ms | 748 KB | Correct answer: answer = 25454 |

72 | Correct | 3 ms | 748 KB | Correct answer: answer = 1504 |

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

74 | Correct | 2 ms | 620 KB | Correct answer: answer = 4284 |

75 | Correct | 2 ms | 2028 KB | Correct answer: answer = 158008 |

76 | Correct | 2 ms | 1004 KB | Correct answer: answer = 51860 |

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

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

79 | Correct | 6 ms | 7020 KB | Correct answer: answer = 998608411647 |

80 | Correct | 52 ms | 94828 KB | Correct answer: answer = 995265560477 |

81 | Correct | 3 ms | 896 KB | Correct answer: answer = 10125000 |

82 | Correct | 4 ms | 1132 KB | Correct answer: answer = 2291668 |

83 | Correct | 14 ms | 2156 KB | Correct answer: answer = 42388 |

84 | Correct | 68 ms | 7148 KB | Correct answer: answer = 10318 |

85 | Correct | 259 ms | 22508 KB | Correct answer: answer = 3416 |

86 | Correct | 3 ms | 1004 KB | Correct answer: answer = 331708193881 |

87 | Correct | 86 ms | 8172 KB | Correct answer: answer = 2861193756 |

88 | Correct | 639 ms | 42732 KB | Correct answer: answer = 114646930 |

89 | Correct | 17 ms | 2540 KB | Correct answer: answer = 9280921 |

90 | Correct | 99 ms | 10348 KB | Correct answer: answer = 999984053400 |

91 | Correct | 455 ms | 32364 KB | Correct answer: answer = 750935949134 |

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

93 | Correct | 64 ms | 126316 KB | Correct answer: answer = 998762383161 |

94 | Correct | 14 ms | 2156 KB | Correct answer: answer = 23017412908 |

95 | Correct | 22 ms | 32108 KB | Correct answer: answer = 728143410622 |

96 | Correct | 2 ms | 748 KB | Correct answer: answer = 2 |

97 | Correct | 5 ms | 1132 KB | Correct answer: answer = 1824916 |

98 | Correct | 204 ms | 17004 KB | Correct answer: answer = 10680029 |

99 | Correct | 89 ms | 8812 KB | Correct answer: answer = 18351700 |

100 | Correct | 3 ms | 876 KB | Correct answer: answer = 16040026 |

101 | Correct | 2 ms | 876 KB | Correct answer: answer = 253968628325 |

102 | Correct | 197 ms | 16236 KB | Correct answer: answer = 10267 |

103 | Correct | 797 ms | 56044 KB | Correct answer: answer = 2582408 |

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

105 | Correct | 3 ms | 1132 KB | Correct answer: answer = 9866346457 |

106 | Correct | 7 ms | 3948 KB | Correct answer: answer = 3327720949 |

107 | Correct | 55 ms | 57964 KB | Correct answer: answer = 86064128360 |

108 | Correct | 185 ms | 92396 KB | Correct answer: answer = 12698259150 |

109 | Correct | 885 ms | 78828 KB | Correct answer: answer = 1185259288 |

110 | Correct | 24 ms | 7660 KB | Correct answer: answer = 999889968863 |

111 | Correct | 24 ms | 9196 KB | Correct answer: answer = 999861384931 |

112 | Correct | 34 ms | 25708 KB | Correct answer: answer = 999811809929 |

113 | Correct | 43 ms | 45164 KB | Correct answer: answer = 999869756441 |

114 | Correct | 29 ms | 7532 KB | Correct answer: answer = 1700000000 |

115 | Correct | 120 ms | 14572 KB | Correct answer: answer = 131666670 |

116 | Correct | 9 ms | 2924 KB | Correct answer: answer = 89478486 |

117 | Correct | 86 ms | 9324 KB | Correct answer: answer = 4971040 |

118 | Correct | 156 ms | 15212 KB | Correct answer: answer = 2711494 |

119 | Correct | 678 ms | 46060 KB | Correct answer: answer = 25252530 |

120 | Correct | 259 ms | 22508 KB | Correct answer: answer = 62500000 |

121 | Correct | 33 ms | 8428 KB | Correct answer: answer = 333175097780 |

122 | Correct | 195 ms | 18540 KB | Correct answer: answer = 33121180179 |

123 | Correct | 694 ms | 46060 KB | Correct answer: answer = 9802314015 |

124 | Correct | 520 ms | 37228 KB | Correct answer: answer = 32567551 |

125 | Correct | 694 ms | 46060 KB | Correct answer: answer = 997525000000 |

126 | Correct | 610 ms | 45932 KB | Correct answer: answer = 752723538884 |

127 | Correct | 19 ms | 6764 KB | Correct answer: answer = 1000000000000 |

128 | Correct | 43 ms | 45164 KB | Correct answer: answer = 999978000121 |

129 | Correct | 44 ms | 45420 KB | Correct answer: answer = 745986144735 |

130 | Correct | 17 ms | 6380 KB | Correct answer: answer = 2 |

131 | Correct | 75 ms | 10604 KB | Correct answer: answer = 277966670 |

132 | Correct | 27 ms | 7532 KB | Correct answer: answer = 2500900082 |

133 | Correct | 23 ms | 6892 KB | Correct answer: answer = 301248349636 |

134 | Correct | 336 ms | 23276 KB | Correct answer: answer = 14118891 |

135 | Correct | 24 ms | 7660 KB | Correct answer: answer = 14384977265 |

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

137 | Correct | 48 ms | 45292 KB | Correct answer: answer = 2720316816 |

138 | Runtime error | 61 ms | 24172 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |

139 | Halted | 0 ms | 0 KB | - |