feat: new dp problem formatted
This commit is contained in:
97
longest-increasing-subsequence-II/Makefile
Normal file
97
longest-increasing-subsequence-II/Makefile
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
# Normal directories
|
||||||
|
SRC_DIR := src
|
||||||
|
BIN_DIR := bin
|
||||||
|
DBG_DIR := bin/debug
|
||||||
|
|
||||||
|
# Grader directories
|
||||||
|
GRADER := $(wildcard $(SRC_DIR)/grader.cpp)
|
||||||
|
GRADER_DIR := $(SRC_DIR)/grader
|
||||||
|
HANDLER_DIR := $(SRC_DIR)/handler
|
||||||
|
|
||||||
|
GRADER_SRC := $(wildcard $(GRADER_DIR)/*.cpp)
|
||||||
|
GRADER_BIN := $(patsubst $(GRADER_DIR)/%.cpp, $(BIN_DIR)/%, $(GRADER_SRC))
|
||||||
|
GRADER_DBG := $(patsubst $(GRADER_DIR)/%.cpp, $(DBG_DIR)/%, $(GRADER_SRC))
|
||||||
|
|
||||||
|
# Change CPP source directories if grader is defined
|
||||||
|
ifdef GRADER
|
||||||
|
SRC := $(wildcard $(HANDLER_DIR)/*.cpp)
|
||||||
|
BIN := $(patsubst $(HANDLER_DIR)/%.cpp, $(BIN_DIR)/%, $(SRC))
|
||||||
|
DBG := $(patsubst $(HANDLER_DIR)/%.cpp, $(DBG_DIR)/%, $(SRC))
|
||||||
|
else
|
||||||
|
SRC := $(wildcard $(SRC_DIR)/*.cpp)
|
||||||
|
BIN := $(patsubst $(SRC_DIR)/%.cpp, $(BIN_DIR)/%, $(SRC))
|
||||||
|
DBG := $(patsubst $(SRC_DIR)/%.cpp, $(DBG_DIR)/%, $(SRC))
|
||||||
|
endif
|
||||||
|
|
||||||
|
SRC_C := $(wildcard $(SRC_DIR)/*.c)
|
||||||
|
BIN_C := $(patsubst $(SRC_DIR)/%.c, $(BIN_DIR)/%, $(SRC_C))
|
||||||
|
DBG_C := $(patsubst $(SRC_DIR)/%.c, $(DBG_DIR)/%, $(SRC_C))
|
||||||
|
|
||||||
|
SRC_JAVA := $(wildcard $(SRC_DIR)/*.java)
|
||||||
|
BIN_JAVA := $(patsubst $(SRC_DIR)/%.java, $(BIN_DIR)/%.class, $(SRC_JAVA))
|
||||||
|
DBG_JAVA := $(patsubst $(SRC_DIR)/%.java, $(DBG_DIR)/%.class, $(SRC_JAVA))
|
||||||
|
|
||||||
|
CHECKER := $(wildcard $(SRC_DIR)/checker.cpp)
|
||||||
|
|
||||||
|
C := gcc
|
||||||
|
CPP := g++
|
||||||
|
CXX_FLAGS := -Wall -O2
|
||||||
|
DEBUG_FLAGS := -Wall -g
|
||||||
|
BOCA_FLAGS := -static -DBOCA_SUPPORT
|
||||||
|
|
||||||
|
JV = javac
|
||||||
|
JV_DEBUG = -g
|
||||||
|
JV_DIR = -d bin
|
||||||
|
JV_DBG_DIR = -d bin/debug
|
||||||
|
|
||||||
|
.PHONY: all debug release checker clean
|
||||||
|
|
||||||
|
all: debug release checker
|
||||||
|
|
||||||
|
debug: $(DBG) $(DBG_C) $(DBG_JAVA) $(GRADER_DBG)
|
||||||
|
|
||||||
|
release: $(BIN) $(BIN_C) $(BIN_JAVA) $(GRADER_BIN)
|
||||||
|
|
||||||
|
ifdef CHECKER
|
||||||
|
checker: $(DBG_DIR)/checker-boca $(BIN_DIR)/checker-boca
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(BIN): $(BIN_DIR)/% : $(SRC_DIR)/%.cpp | $(BIN_DIR)
|
||||||
|
$(CPP) $(CXX_FLAGS) $^ -o $@
|
||||||
|
|
||||||
|
$(DBG): $(DBG_DIR)/% : $(SRC_DIR)/%.cpp | $(DBG_DIR)
|
||||||
|
$(CPP) $(DEBUG_FLAGS) $^ -o $@
|
||||||
|
|
||||||
|
$(BIN_C): $(BIN_DIR)/% : $(SRC_DIR)/%.c | $(BIN_DIR)
|
||||||
|
$(C) $(CXX_FLAGS) $^ -o $@
|
||||||
|
|
||||||
|
$(DBG_C): $(DBG_DIR)/% : $(SRC_DIR)/%.c | $(DBG_DIR)
|
||||||
|
$(C) $(DEBUG_FLAGS) $^ -o $@
|
||||||
|
|
||||||
|
$(BIN_JAVA): $(BIN_DIR)/%.class : $(SRC_DIR)/%.java | $(BIN_DIR)
|
||||||
|
$(JV) $(JV_DIR) $^
|
||||||
|
|
||||||
|
$(DBG_JAVA): $(DBG_DIR)/%.class : $(SRC_DIR)/%.java | $(DBG_DIR)
|
||||||
|
$(JV) $(JV_DEBUG) $(JV_DBG_DIR) $^
|
||||||
|
|
||||||
|
$(GRADER_BIN): $(BIN_DIR)/% : $(GRADER_DIR)/%.cpp $(GRADER) $(GRADER_DIR)/*.h
|
||||||
|
$(CPP) $(CXX_FLAGS) $^ -o $@
|
||||||
|
|
||||||
|
$(GRADER_DBG): $(DBG_DIR)/% : $(GRADER_DIR)/%.cpp $(GRADER) $(GRADER_DIR)/*.h
|
||||||
|
$(CPP) $(DEBUG_FLAGS) $^ -o $@
|
||||||
|
|
||||||
|
$(BIN_DIR):
|
||||||
|
mkdir -p $@
|
||||||
|
|
||||||
|
$(DBG_DIR):
|
||||||
|
mkdir -p $@
|
||||||
|
|
||||||
|
$(BIN_DIR)/checker-boca: $(SRC_DIR)/checker.cpp
|
||||||
|
$(CPP) $(CXX_FLAGS) $(BOCA_FLAGS) $^ -o $@
|
||||||
|
|
||||||
|
$(DBG_DIR)/checker-boca: $(SRC_DIR)/checker.cpp
|
||||||
|
$(CPP) $(DEBUG_FLAGS) $(BOCA_FLAGS) $^ -o $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@echo Cleaning problem files
|
||||||
|
rm -rf bin
|
||||||
2
longest-increasing-subsequence-II/input/1
Normal file
2
longest-increasing-subsequence-II/input/1
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
5
|
||||||
|
1 2 3 4 5
|
||||||
2
longest-increasing-subsequence-II/input/10
Normal file
2
longest-increasing-subsequence-II/input/10
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/11
Normal file
2
longest-increasing-subsequence-II/input/11
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
893
|
||||||
|
9847 -1107 2743 7832 -1546 -1039 -4983 4424 1564 -2524 -3700 9972 -2871 2731 -6361 -6444 7132 -8878 -797 -5676 -4018 21 -3950 21 7315 -5311 -8753 -5767 -3654 8326 -7817 6944 6576 -2292 669 8386 -3453 -5790 7793 -3108 9364 -4929 6191 4317 -6777 -1194 1788 -9046 5845 6528 -1730 -5531 8139 6599 -2676 3113 -2923 -6759 8506 -4861 -2651 -3531 -720 -9377 7442 -7643 8366 -4972 -1736 -6361 7641 -9975 -7842 8039 -9570 4330 -7618 1675 -5817 3918 -4080 9031 2299 649 7632 8221 5370 3442 -2652 -8455 -782 -2259 581 -3653 1417 -71 8415 3791 -569 -8484 5630 8069 -7643 2733 -4599 8081 4029 -3838 4203 2678 3255 5383 4660 -7576 4261 8925 -7517 -112 4336 4438 3776 -110 -5125 2518 1725 2362 1371 -2868 -5301 5004 -1671 -5324 9171 -2318 7752 8498 -6124 4079 -7513 -2015 -5193 -5304 9449 4635 -3817 8026 8174 -2647 -6119 8303 7759 3772 2898 311 -2028 7892 9291 6752 3251 -3079 4247 2291 -9755 -2798 7373 -305 7304 2029 -8861 -3766 -5663 9401 -246 2093 8578 5955 -7767 -3567 -9043 2314 -5895 -9951 -8088 -222 770 2832 -6598 2109 -1787 -487 6641 5714 5868 -7055 7478 9445 -3338 5967 -1891 -5110 -7847 -1357 -8576 -6575 -7381 0 -2870 -9444 -3965 9716 -793 8491 -1246 468 -5920 -9187 -6157 -3179 4885 -5166 2983 7654 -537 -8260 -7794 -9796 9761 6303 4189 -592 -7616 -1728 -4542 9687 5617 9777 -63 4615 -4195 -3414 5955 -9803 -8599 -3010 9133 -3875 5550 -4858 -4904 -7214 8978 3743 3037 2192 -6864 7857 -6492 -8587 -1479 -8359 -1290 -4060 1157 -1428 -3001 5209 -2226 4950 -355 4224 3225 426 -5528 1574 -7940 1859 -4037 1790 -1322 6540 5879 -6565 7283 -2223 -2755 4621 658 -217 -5056 3993 -4817 -8082 1399 -3316 -3829 3791 -5976 1697 -7209 -7958 7822 -3890 8869 3707 5007 615 1686 -8933 1844 7892 9424 7154 -4764 9977 8605 -1672 6152 -8723 9348 7025 -160 2886 1901 2961 -9270 1519 6268 1549 4631 -9055 -2862 8702 9455 5114 -7862 5086 -6624 7925 5448 -1323 6024 -6124 6967 -7607 -2702 -7047 2182 -4128 8490 -359 9450 -6585 4316 7773 -2098 6286 -1304 -95 5365 8231 -1264 -5028 8189 -5079 -2033 -7062 1968 -2620 -6918 -1784 -2232 -599 2575 -6602 -2987 7606 2394 3137 -6834 -9670 -7117 5963 4852 2748 9457 2423 -5726 -7875 6288 9860 373 -5322 6025 -216 5279 3784 -6267 1121 9812 6492 3199 5586 2672 -4828 -7095 7015 -784 -3949 -2531 3713 -2180 -7414 -9986 5086 -3184 6228 -7214 -6595 837 4021 -4633 -3548 -5041 -447 -282 1951 -1986 152 9616 -1283 -4140 3655 -3724 7969 4383 9524 8757 -5408 7923 4457 6075 5763 -2902 9063 5159 -5318 -8945 -8512 -7898 5205 3433 -5240 4506 -8852 -454 -7464 6482 7925 3402 5866 9770 1584 1736 -9687 8783 -6881 531 -7862 -3497 6568 -7376 -741 -3421 -2641 2374 -9552 -6965 3812 8620 2845 -2614 4769 3238 -4266 2824 -8333 -8745 3350 3109 4831 -357 -3925 7390 -5292 9561 2756 6991 -9786 2157 -9394 378 -5671 -2072 -5220 -4509 -6668 7596 -8604 -2573 5568 2783 9478 7889 -5813 3995 1811 8382 -4627 9993 8694 5007 8650 3491 -2186 2148 -8796 -1595 -2242 -8470 170 6737 4500 2499 -5070 -8779 605 -3433 5673 -5878 75 -4572 3002 4221 -8780 8993 52 -1653 5563 -9641 -32 1481 -9853 2516 -8138 -3095 8112 -2306 4031 5261 -4743 6835 -489 -5742 9333 4064 -2281 8468 6473 -6708 8060 6622 -8082 -4362 6067 1946 -6891 -9278 198 -8505 -3389 3098 8547 7262 3071 -3992 -1821 8698 -632 -4115 4693 9880 -822 7845 -1565 6501 -1035 -4565 6497 -2296 -8669 -7776 8107 -6376 -8553 7356 691 -1463 4814 -8306 6380 335 1388 -9698 -9347 7036 2173 602 5954 -8817 -9145 -3690 -2476 -6276 -5439 1001 4909 -3625 3562 -9267 5312 5137 906 7560 -3225 -5977 6840 4056 -2015 4062 1659 306 -1836 -4850 7302 -9719 5304 912 8520 -893 -5951 1532 4091 -8055 4461 2725 -889 -8637 3625 5189 8772 7919 8355 -9155 6149 9518 -4672 720 -5025 -2988 -9547 4576 -4269 -5728 -4804 8151 -721 914 -8485 5681 6832 -7241 -7074 3359 9986 3799 -6154 8908 7882 6163 7786 6152 -185 6535 2543 -3641 7607 6132 8238 -5209 164 6433 8410 -6462 -5065 -6393 -2489 6298 -6474 6913 5786 1347 5753 -893 7948 -3711 6784 -2545 -216 -6613 5775 -9863 -9032 28 -6523 1190 -9137 9765 5949 -1828 8909 996 -3836 6155 4406 621 7549 -3527 6071 -9027 8468 -2812 9592 3177 -444 7498 -9230 4629 -2662 881 7197 -7717 9199 -3717 7122 5254 688 -6056 -7607 4487 1442 -7341 -8976 4974 9791 6043 6539 494 -1804 9478 -2808 -7703 1776 9949 1390 -8073 -6098 -5460 1816 -6994 -6478 -8493 -5671 -6895 -316 3755 -2314 2579 -1118 -7989 7086 -7407 -1866 888 3738 1065 -409 2026 7715 4255 9648 1616 7848 -2402 -1294 -6713 -5289 1597 -6044 -6551 9874 -2339 5779 6885 -3552 -5224 7217 4920 2042 -8395 2857 -5866 -3330 9596 4618 8840 -3523 1782 -5715 7383 4367 -8680 409 -5122 6983 8892 5302 -7157 -4420 4252 -3180 1230 -554 3455 -2412 36 -8570 -5503 5883 -5135 -1367 -7654 5461 -1051 -7524 673 3575 8665 9248 8180 -9042 3654 9528 -3380 -1867 -3372 -596 -9484 1797 125 -8858 7702 485 -5835 -6421 -9723 1556 718 7754 -5093 -6742 3464 3805 -1936 -5128 -431 -382 -540 -5371 164 62 -4235 4161 -6638
|
||||||
2
longest-increasing-subsequence-II/input/12
Normal file
2
longest-increasing-subsequence-II/input/12
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/13
Normal file
2
longest-increasing-subsequence-II/input/13
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/14
Normal file
2
longest-increasing-subsequence-II/input/14
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/15
Normal file
2
longest-increasing-subsequence-II/input/15
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/16
Normal file
2
longest-increasing-subsequence-II/input/16
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/17
Normal file
2
longest-increasing-subsequence-II/input/17
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/18
Normal file
2
longest-increasing-subsequence-II/input/18
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/19
Normal file
2
longest-increasing-subsequence-II/input/19
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/2
Normal file
2
longest-increasing-subsequence-II/input/2
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
4
|
||||||
|
2 3 -1 4
|
||||||
2
longest-increasing-subsequence-II/input/20
Normal file
2
longest-increasing-subsequence-II/input/20
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/21
Normal file
2
longest-increasing-subsequence-II/input/21
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/22
Normal file
2
longest-increasing-subsequence-II/input/22
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/23
Normal file
2
longest-increasing-subsequence-II/input/23
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
229
|
||||||
|
-905 -3012 2788 -6594 -2184 -3879 9355 2741 6590 9913 -2007 -6634 -4119 1848 -1114 -897 6722 -6717 8628 4170 -4104 -4171 -8797 -1156 6850 -786 1143 9373 9243 3213 5205 6727 -5080 6436 3999 -5484 -4297 8498 3277 3717 -7384 7543 6640 9124 6730 512 2533 5127 -3227 -1346 -2918 1882 -5588 -7282 2180 2814 -9102 1123 6078 6118 200 1946 -7619 -6395 4520 -7335 -6162 7265 3465 -3459 -3201 8623 2159 -8768 971 -8540 -3220 5257 437 5569 3747 9536 -833 -8538 -1942 -4132 -7415 -8610 -768 -5682 9359 7197 -2784 -4815 -9474 -3754 5082 8522 4400 3404 -4756 -6944 329 -8086 6407 4773 -2821 3841 -3280 -2143 4032 5541 5646 5814 2060 4768 5629 6188 -5096 118 4434 -4198 -6997 3061 -6063 -7333 6220 3594 -3222 -5699 9886 6646 -2741 -468 150 6176 8351 -8977 7742 -9734 9234 6275 -4771 3629 -5033 8816 -5258 -3051 -4101 -1090 -9029 -3911 -3801 9948 6721 9841 2953 -5673 -2231 -158 819 -7591 3282 2552 -1431 -126 188 2945 -5586 4841 8421 2356 -2411 -8863 7143 -1259 8756 3240 719 -6354 -6640 -1628 9706 -8470 -3025 453 3086 -7327 -6031 -6061 7256 7043 -7212 -4611 -5907 -3939 8930 4496 -6463 2606 1749 5187 -8393 -762 -4540 6867 -6106 -3675 -8078 -5423 547 7405 7892 2230 -8654 3898 -8981 4071 -3551 7272 3859 -1378 4847 1459 -6434 4613 -334 -8490 -1107
|
||||||
2
longest-increasing-subsequence-II/input/24
Normal file
2
longest-increasing-subsequence-II/input/24
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/25
Normal file
2
longest-increasing-subsequence-II/input/25
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/26
Normal file
2
longest-increasing-subsequence-II/input/26
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/27
Normal file
2
longest-increasing-subsequence-II/input/27
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/28
Normal file
2
longest-increasing-subsequence-II/input/28
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/29
Normal file
2
longest-increasing-subsequence-II/input/29
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/3
Normal file
2
longest-increasing-subsequence-II/input/3
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
1
|
||||||
|
0
|
||||||
2
longest-increasing-subsequence-II/input/30
Normal file
2
longest-increasing-subsequence-II/input/30
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/31
Normal file
2
longest-increasing-subsequence-II/input/31
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/32
Normal file
2
longest-increasing-subsequence-II/input/32
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/33
Normal file
2
longest-increasing-subsequence-II/input/33
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/34
Normal file
2
longest-increasing-subsequence-II/input/34
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/35
Normal file
2
longest-increasing-subsequence-II/input/35
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/36
Normal file
2
longest-increasing-subsequence-II/input/36
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/37
Normal file
2
longest-increasing-subsequence-II/input/37
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/4
Normal file
2
longest-increasing-subsequence-II/input/4
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
4
|
||||||
|
-10000 -10000 -10000 -10000
|
||||||
2
longest-increasing-subsequence-II/input/5
Normal file
2
longest-increasing-subsequence-II/input/5
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
9
|
||||||
|
0 0 0 0 -1 -1 -1 -1 -1
|
||||||
2
longest-increasing-subsequence-II/input/6
Normal file
2
longest-increasing-subsequence-II/input/6
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/7
Normal file
2
longest-increasing-subsequence-II/input/7
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/8
Normal file
2
longest-increasing-subsequence-II/input/8
Normal file
File diff suppressed because one or more lines are too long
2
longest-increasing-subsequence-II/input/9
Normal file
2
longest-increasing-subsequence-II/input/9
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,41 @@
|
|||||||
|
\documentclass{maratona}
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
\begin{ProblemaAutor}{}{Maior subsequência Crescente II}{1}{256}{}
|
||||||
|
|
||||||
|
O problema consiste em determinar a maior subsequência crescente de uma sequência de números inteiros.
|
||||||
|
Uma subsequência é formada ao remover zero ou mais elementos da sequência original, sem alterar a ordem relativa dos elementos restantes.
|
||||||
|
A subsequência procurada deve conter pelo menos um elemento, e seus valores devem estar em ordem estritamente crescente, isto é, para todos os índices válidos \( i \) e \( j \) pertencentes à subsequência, se \( i < j \) então \( a_i < a_j \).
|
||||||
|
O objetivo é identificar essa subsequência de tamanho máximo e apresentar tanto o seu comprimento quanto os próprios elementos.
|
||||||
|
|
||||||
|
\Entrada
|
||||||
|
|
||||||
|
A entrada é composta por duas linhas.
|
||||||
|
A primeira linha contém um inteiro \( N \) (\( 1 \leq N \leq 10^5 \)), representando o número de elementos da sequência.
|
||||||
|
A segunda linha contém \( N \) inteiros \( a_1, a_2, \ldots, a_N \) (\( -10^4 \leq a_i \leq 10^4 \)), separados por espaços, correspondentes aos elementos da sequência.
|
||||||
|
|
||||||
|
\Saida
|
||||||
|
|
||||||
|
A saída deve conter duas linhas.
|
||||||
|
A primeira linha deve conter um único inteiro representando o tamanho \( L \) da maior subsequência crescente.
|
||||||
|
A segunda linha deve conter \( L \) inteiros \( b_1, b_2, \ldots, b_L \), correspondentes aos elementos dessa subsequência, na mesma ordem em que aparecem na sequência original, separados por um espaço.
|
||||||
|
|
||||||
|
\ExemploEntrada
|
||||||
|
\begin{Exemplo}
|
||||||
|
\texttt{5} & \texttt{5}\\
|
||||||
|
\texttt{1~2~3~4~5} & \texttt{1~2~3~4~5}\\
|
||||||
|
\rowcolor{gray!20}\texttt{4} & \texttt{3}\\
|
||||||
|
\rowcolor{gray!20}\texttt{2~3~-1~4} & \texttt{2~3~4}\\
|
||||||
|
\texttt{1} & \texttt{1}\\
|
||||||
|
\texttt{0} & \texttt{0}\\
|
||||||
|
\end{Exemplo}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\Notas
|
||||||
|
|
||||||
|
Para a sequência \( (1, 2, 3, 4, 5) \), toda a sequência já é estritamente crescente, portanto o tamanho da subsequência é \( L = 5 \) e ela contém os mesmos elementos.
|
||||||
|
Para a sequência \( (2, 3, -1, 4) \), uma das maiores subsequências crescentes possíveis é \( (2, 3, 4) \), com tamanho \( L = 3 \).
|
||||||
|
Para a sequência \( (0) \), há apenas um elemento, então a maior subsequência crescente é o próprio número \( 0 \), com tamanho \( L = 1 \).
|
||||||
|
\end{ProblemaAutor}
|
||||||
|
\end{document}
|
||||||
188
longest-increasing-subsequence-II/maratona.cls
Normal file
188
longest-increasing-subsequence-II/maratona.cls
Normal file
@@ -0,0 +1,188 @@
|
|||||||
|
\ProvidesPackage{maratona}
|
||||||
|
\LoadClass[11pt]{article}
|
||||||
|
|
||||||
|
% remove page numbers
|
||||||
|
\pagenumbering{gobble}
|
||||||
|
|
||||||
|
\RequirePackage{fancyhdr}
|
||||||
|
|
||||||
|
\RequirePackage{tabularx,colortbl}
|
||||||
|
|
||||||
|
%\RequirePackage{arial}
|
||||||
|
\RequirePackage{ifpdf}
|
||||||
|
\RequirePackage[T1]{fontenc}
|
||||||
|
\RequirePackage[utf8]{inputenc}
|
||||||
|
\RequirePackage[portuguese]{babel}
|
||||||
|
\RequirePackage{graphics}
|
||||||
|
\RequirePackage{graphicx}
|
||||||
|
\RequirePackage{amssymb,amsmath,wrapfig}
|
||||||
|
\RequirePackage{xcolor,colortbl}
|
||||||
|
\RequirePackage{xcolor}
|
||||||
|
\RequirePackage{ifthen}
|
||||||
|
\oddsidemargin 0cm
|
||||||
|
\evensidemargin -2cm
|
||||||
|
\topmargin -1cm
|
||||||
|
\textwidth 16cm
|
||||||
|
\textheight 23cm
|
||||||
|
|
||||||
|
\ifpdf
|
||||||
|
\RequirePackage[pdftex]{hyperref}
|
||||||
|
\else
|
||||||
|
\RequirePackage[hypertex]{hyperref}
|
||||||
|
\fi
|
||||||
|
|
||||||
|
|
||||||
|
\newcommand{\var}[1]{\ensuremath{{#1}}}
|
||||||
|
|
||||||
|
|
||||||
|
\hypersetup{
|
||||||
|
letterpaper,
|
||||||
|
colorlinks=true,
|
||||||
|
linkcolor=blue,
|
||||||
|
urlcolor=blue,
|
||||||
|
pdfpagemode=none,
|
||||||
|
pdftitle={IV Maratona de Programação do IFB \today},
|
||||||
|
pdfauthor={},
|
||||||
|
pdfsubject={Caderno de problemas da IV Maratona de Programação do IFB },
|
||||||
|
pdfkeywords={maratona, programação, IFB}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\DeclareGraphicsExtensions{png}
|
||||||
|
|
||||||
|
\lhead{DS Contest Tools}
|
||||||
|
\pagestyle{fancy}
|
||||||
|
|
||||||
|
% Capa
|
||||||
|
\newenvironment{Maratona}[3]
|
||||||
|
{
|
||||||
|
\begin{titlepage}
|
||||||
|
\begin{center}
|
||||||
|
|
||||||
|
\vspace{1cm}
|
||||||
|
\Large{\textbf{#1}} \\
|
||||||
|
\vspace{1cm}
|
||||||
|
{\textbf{Caderno de Problemas}} \\
|
||||||
|
\vspace{1cm}
|
||||||
|
\begin{small}
|
||||||
|
\textsl{#2}
|
||||||
|
\end{small} \\
|
||||||
|
\begin{figure}[htp]
|
||||||
|
\begin{center}
|
||||||
|
\includegraphics[scale=1]{logos/logo-maratona.png}
|
||||||
|
\end{center}
|
||||||
|
\end{figure}
|
||||||
|
{(Este caderno contém {#3} problemas)} \\
|
||||||
|
\vspace{1cm}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
\vfill
|
||||||
|
\begin{small}
|
||||||
|
{QNM 40, Área Especial nº 01,
|
||||||
|
Taguatinga/DF, 72146-000 ,
|
||||||
|
Brasil } \\
|
||||||
|
{Telefone (61) 2103-2200 \\http://www.ifb.edu.br/taguatinga} \\
|
||||||
|
\end{small}
|
||||||
|
\end{center}
|
||||||
|
\end{titlepage}
|
||||||
|
}
|
||||||
|
|
||||||
|
\newcommand{\Organizacao}[2]{
|
||||||
|
{\small \vfill
|
||||||
|
\begin{center}
|
||||||
|
|
||||||
|
\textbf{Comissão Organizadora:} \\
|
||||||
|
{#1} \\
|
||||||
|
\bigskip
|
||||||
|
\textbf{Apoio:}\\
|
||||||
|
{#2}
|
||||||
|
\end{center}
|
||||||
|
}
|
||||||
|
\vfill
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
% Problema
|
||||||
|
\newcounter{problem}
|
||||||
|
\newenvironment{Problema}[4]{
|
||||||
|
\stepcounter{problem}
|
||||||
|
\newpage
|
||||||
|
\begin{center}
|
||||||
|
\Large{\ifthenelse{\equal{#1}{}}{\textbf{{#2}}}{\textbf{Problema {#1} -- {#2} }}}{\\\footnotesize \textbf{Limite de tempo: {#3}s}}{\\[-0.1cm]\footnotesize \textbf{Limite de memória: {#4}MB}}
|
||||||
|
\end{center}
|
||||||
|
}
|
||||||
|
|
||||||
|
\newcounter{problemAutor}
|
||||||
|
\newenvironment{ProblemaAutor}[5]{
|
||||||
|
\stepcounter{problemAutor}
|
||||||
|
\newpage
|
||||||
|
\begin{center}
|
||||||
|
\Large{\ifthenelse{\equal{#1}{}}{\textbf{{#2}}}{\textbf{Problema {#1} -- {#2} }}}{\\\footnotesize \textbf{Limite de tempo: {#3}s}}{\\[-0.1cm]\footnotesize \textbf{Limite de memória: {#4}MB\\}}{
|
||||||
|
\footnotesize Autor: {#5}
|
||||||
|
}
|
||||||
|
\end{center}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
% Código-fonte
|
||||||
|
\newcommand{\codigofonte}[1]{Nome do arquivo fonte: {#1}}
|
||||||
|
|
||||||
|
% Entrada
|
||||||
|
\newcommand{\Entrada}{
|
||||||
|
\bigskip
|
||||||
|
\begin{large}
|
||||||
|
\textbf{Entrada} \\
|
||||||
|
\end{large}
|
||||||
|
}
|
||||||
|
|
||||||
|
% Saida
|
||||||
|
\newcommand{\Saida}{
|
||||||
|
\bigskip
|
||||||
|
\begin{large}
|
||||||
|
\textbf{Saída} \\
|
||||||
|
\end{large}
|
||||||
|
}
|
||||||
|
|
||||||
|
\newcommand{\Interacao}{
|
||||||
|
\bigskip
|
||||||
|
\begin{large}
|
||||||
|
\textbf{Interação} \\
|
||||||
|
\end{large}
|
||||||
|
}
|
||||||
|
|
||||||
|
\newcommand{\Notas}{
|
||||||
|
\bigskip
|
||||||
|
\begin{large}
|
||||||
|
\textbf{Notas} \\
|
||||||
|
\end{large}
|
||||||
|
}
|
||||||
|
|
||||||
|
% Exemplo
|
||||||
|
\newenvironment{Exemplo}
|
||||||
|
{
|
||||||
|
|
||||||
|
\tabularx{\textwidth}{XX}
|
||||||
|
% {@{\extracolsep{\fill}}|l|l|}
|
||||||
|
% {|l|l@{\extracolsep{\fill}|}}
|
||||||
|
\hline
|
||||||
|
Entrada & Saída \\\hline
|
||||||
|
}
|
||||||
|
{
|
||||||
|
\hline
|
||||||
|
\endtabularx
|
||||||
|
}
|
||||||
|
|
||||||
|
% Exemplo de Entrada
|
||||||
|
\newenvironment{ExemploEntrada}
|
||||||
|
{
|
||||||
|
\bigskip
|
||||||
|
\begin{large}
|
||||||
|
\textbf{Exemplo} \\
|
||||||
|
\end{large}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
% Sample Output
|
||||||
|
|
||||||
2
longest-increasing-subsequence-II/output/1
Normal file
2
longest-increasing-subsequence-II/output/1
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
5
|
||||||
|
1 2 3 4 5
|
||||||
2
longest-increasing-subsequence-II/output/10
Normal file
2
longest-increasing-subsequence-II/output/10
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
251
|
||||||
|
-9964 -9680 -9671 -9622 -9448 -9142 -9016 -8927 -8711 -8668 -8550 -8525 -8439 -8336 -8289 -8252 -8219 -8216 -8096 -8091 -8068 -7856 -7834 -7822 -7735 -7576 -7335 -7272 -7215 -7029 -6922 -6917 -6697 -6655 -6611 -6518 -6474 -6287 -6267 -6233 -5985 -5957 -5800 -5709 -5511 -5368 -5214 -5193 -5171 -5098 -4782 -4704 -4642 -4609 -4386 -4330 -4326 -4274 -4177 -4169 -4057 -3974 -3780 -3747 -3678 -3664 -3601 -3527 -3482 -3430 -3377 -3284 -3074 -3045 -2975 -2964 -2917 -2701 -2483 -2459 -2411 -2349 -2294 -2285 -2272 -2220 -2107 -2085 -2069 -2034 -1984 -1775 -1696 -1601 -1569 -1508 -1476 -1442 -1372 -1322 -1199 -1189 -1104 -907 -878 -839 -838 -548 -546 -473 -460 -417 -392 -363 -275 -246 -81 -41 72 151 172 239 248 315 335 344 585 623 632 671 696 764 816 848 1046 1076 1082 1257 1278 1385 1452 1453 1651 1694 2228 2365 2398 2416 2468 2604 2745 2961 3093 3123 3160 3177 3186 3216 3226 3264 3272 3295 3586 3763 3838 3899 3944 4006 4048 4074 4092 4132 4155 4224 4244 4478 4494 4701 4706 4811 4857 4894 4965 4977 5046 5068 5172 5227 5482 5488 5496 5556 5618 5620 5712 5795 5914 5920 5953 5997 6015 6055 6056 6142 6218 6265 6369 6409 6737 6786 6817 7172 7231 7341 7435 7460 7562 7613 7627 7961 7966 7981 8082 8096 8097 8119 8199 8244 8272 8278 8339 8348 8462 8490 8587 8631 8745 8967 9160 9196 9223 9240 9337 9530 9580 9595 9705 9794 9820 9887 9924
|
||||||
2
longest-increasing-subsequence-II/output/11
Normal file
2
longest-increasing-subsequence-II/output/11
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
54
|
||||||
|
-8878 -8753 -7817 -7643 -7618 -7576 -7517 -7513 -7055 -6575 -6157 -5166 -4542 -4195 -3414 -3010 -3001 -2226 -2223 -1672 -1323 -1304 -1264 -784 -447 -282 152 1584 1736 2374 2845 3238 3350 3491 4031 4064 4693 4814 4909 5137 5189 5681 5753 5775 5949 6043 6539 7086 7715 7848 8840 8892 9248 9528
|
||||||
2
longest-increasing-subsequence-II/output/12
Normal file
2
longest-increasing-subsequence-II/output/12
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
96
|
||||||
|
-9996 -9936 -9772 -9682 -9475 -9390 -9375 -9046 -8912 -8449 -8394 -8151 -7997 -7891 -7831 -7629 -7566 -7490 -7059 -6706 -6581 -6505 -6471 -6120 -5845 -5546 -5471 -5374 -4669 -4205 -4200 -3863 -3661 -3192 -2237 -2182 -2029 -1891 -1752 -1567 -1482 -1301 -1242 -1107 -1093 -844 -458 -333 -257 -202 -66 97 359 956 1161 1814 2086 2385 3202 3276 3371 3616 3661 3671 3759 3839 4251 4744 4941 4942 5054 5722 5879 5917 6315 6476 6505 6706 6707 7190 7437 7799 8167 8317 8501 8515 8727 8732 8772 8812 8856 8861 9020 9266 9542 9745
|
||||||
2
longest-increasing-subsequence-II/output/13
Normal file
2
longest-increasing-subsequence-II/output/13
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
218
|
||||||
|
-9610 -9481 -9397 -9327 -9067 -8961 -8904 -8844 -8794 -8707 -8648 -8623 -8465 -8364 -8342 -8288 -8272 -7888 -7742 -7712 -7300 -7064 -6898 -6787 -6775 -6771 -6668 -6660 -6574 -6417 -6405 -6293 -6205 -6198 -6142 -5955 -5855 -5821 -5791 -5731 -5724 -5719 -5604 -5600 -5591 -5575 -5556 -5544 -5440 -5352 -5156 -5084 -5027 -4887 -4861 -4722 -4715 -4644 -4496 -4461 -4450 -4357 -4347 -4344 -4150 -4059 -4036 -4021 -3829 -3810 -3749 -3702 -3661 -3540 -3363 -3273 -3213 -2921 -2782 -2517 -2343 -2268 -2189 -2081 -2067 -1886 -1863 -1776 -1742 -1691 -1508 -1272 -1133 -1072 -1019 -811 -781 -693 -170 -156 0 60 120 261 376 450 609 613 649 789 813 953 1039 1132 1145 1162 1193 1219 1370 1464 1516 1587 1597 1633 1759 2009 2135 2171 2310 2352 2528 2558 2753 2816 2906 2927 2989 3283 3293 3344 3372 3462 3495 3534 3655 3900 4062 4155 4164 4316 4393 4458 4507 4546 4638 4730 4853 5030 5061 5103 5136 5264 5294 5326 5486 5540 5642 5676 5751 5926 5970 6028 6044 6080 6249 6274 6308 6358 6712 6732 6954 7155 7309 7330 7342 7357 7381 7382 7388 7392 7555 7570 7649 7653 7659 7767 7893 7921 7935 8021 8131 8134 8380 8467 8481 8539 8567 8722 8867 9036 9041 9122 9145 9264 9321 9483 9485 9503
|
||||||
2
longest-increasing-subsequence-II/output/14
Normal file
2
longest-increasing-subsequence-II/output/14
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
300
|
||||||
|
-9945 -9910 -9852 -9791 -9647 -9644 -9584 -9523 -9510 -9367 -9275 -9274 -9237 -9227 -9185 -9101 -8996 -8873 -8782 -8624 -8616 -8378 -8355 -8271 -8188 -8111 -7918 -7830 -7718 -7703 -7640 -7612 -7568 -7540 -7529 -7395 -7350 -7286 -7089 -6991 -6926 -6920 -6590 -6539 -6523 -6511 -6411 -6193 -6083 -6051 -5602 -5530 -5460 -5366 -5337 -5314 -5182 -4917 -4868 -4835 -4730 -4712 -4643 -4451 -4351 -4318 -4286 -4252 -4250 -4215 -4154 -3926 -3912 -3896 -3762 -3702 -3608 -3574 -3559 -3552 -3497 -3366 -3270 -3202 -3193 -2969 -2787 -2764 -2699 -2647 -2598 -2550 -2483 -2441 -2316 -2303 -2280 -2235 -2205 -2186 -2181 -1921 -1758 -1727 -1590 -1544 -1519 -1408 -1310 -1136 -1030 -543 -512 -461 -451 -397 -388 -271 -257 -94 -43 12 109 136 226 317 351 422 448 569 612 719 759 766 991 1162 1224 1279 1291 1370 1379 1427 1452 1508 1553 1622 1701 1714 1769 1831 1834 1864 1938 1973 2056 2061 2133 2135 2156 2158 2501 2530 2538 2561 2627 2660 2801 2972 3049 3064 3234 3329 3332 3346 3436 3602 3676 3730 3745 3757 3837 3910 3923 4011 4019 4267 4277 4293 4297 4341 4348 4393 4510 4561 4625 4628 4673 4679 4719 4762 4904 4941 4970 4984 5010 5024 5044 5051 5071 5098 5148 5187 5417 5458 5711 5783 5832 5910 5963 6012 6037 6095 6144 6177 6183 6187 6198 6200 6261 6264 6285 6348 6387 6485 6488 6545 6556 6565 6593 6625 6694 6699 6795 6849 6859 6951 7030 7116 7155 7230 7233 7284 7361 7564 7599 7662 7688 7746 7775 7802 7901 7975 8077 8194 8201 8210 8341 8414 8434 8481 8519 8681 8698 8709 8729 8740 8752 8777 8801 8990 8991 9024 9055 9136 9147 9182 9235 9237 9242 9299 9427 9437 9564 9583 9650 9711 9907 9946 9950 9968
|
||||||
2
longest-increasing-subsequence-II/output/15
Normal file
2
longest-increasing-subsequence-II/output/15
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
332
|
||||||
|
-9969 -9934 -9910 -9804 -9762 -9735 -9667 -9482 -9470 -9390 -9343 -9232 -9219 -9179 -9157 -9054 -9037 -8982 -8860 -8837 -8757 -8715 -8681 -8547 -8522 -8445 -8421 -8386 -8363 -8351 -8337 -8222 -8216 -8199 -8094 -8059 -8002 -7928 -7920 -7846 -7801 -7796 -7732 -7659 -7653 -7546 -7425 -7394 -7352 -7336 -7233 -6969 -6966 -6781 -6693 -6618 -6562 -6351 -6236 -6219 -6215 -6186 -6181 -6124 -6117 -6103 -5939 -5878 -5839 -5739 -5699 -5653 -5512 -5490 -5309 -5305 -5231 -5012 -5010 -4995 -4955 -4834 -4812 -4795 -4678 -4607 -4576 -4471 -4449 -4439 -4431 -4406 -4236 -4143 -4139 -3892 -3835 -3793 -3645 -3454 -3320 -3231 -3146 -3145 -3127 -3086 -3039 -2987 -2939 -2867 -2857 -2752 -2711 -2644 -2626 -2542 -2523 -2501 -2478 -2349 -2290 -2182 -2122 -2115 -2091 -2043 -1885 -1774 -1691 -1657 -1577 -1122 -1071 -911 -838 -762 -733 -654 -583 -451 -383 -281 -263 -257 -234 76 192 248 266 423 456 471 500 501 685 762 822 844 891 1012 1197 1469 1640 1647 1694 1722 1771 1801 1831 1890 1921 1968 1992 2072 2099 2103 2111 2133 2174 2176 2246 2321 2361 2396 2411 2474 2537 2563 2645 2701 2745 2778 2790 2934 2955 2971 2975 3053 3082 3228 3236 3250 3284 3335 3371 3381 3432 3467 3468 3495 3563 3631 3707 3719 3919 3938 3989 4039 4083 4123 4238 4281 4491 4632 4635 4688 4719 4746 4800 4826 4881 5106 5163 5173 5211 5336 5345 5351 5410 5520 5541 5657 5698 5701 5710 5753 5798 5850 5869 5913 6045 6329 6401 6430 6469 6527 6592 6649 6666 6677 6734 6738 6740 6752 6756 6764 6861 6892 6953 6993 7003 7051 7063 7135 7191 7277 7389 7397 7515 7517 7531 7539 7548 7563 7574 7682 7914 7976 7985 8060 8100 8183 8292 8302 8307 8376 8437 8482 8488 8547 8585 8723 8897 8918 8941 8961 9025 9063 9084 9140 9156 9305 9336 9350 9358 9405 9437 9438 9455 9464 9545 9576 9637 9640 9641 9645 9706 9879 9880 9948 9949 9971
|
||||||
2
longest-increasing-subsequence-II/output/16
Normal file
2
longest-increasing-subsequence-II/output/16
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
341
|
||||||
|
-9939 -9818 -9793 -9762 -9693 -9672 -9646 -9643 -9637 -9541 -9539 -9538 -9502 -9451 -9446 -9348 -9339 -9286 -9267 -9262 -9215 -9156 -9072 -8956 -8894 -8868 -8833 -8780 -8721 -8689 -8638 -8632 -8455 -8436 -8132 -8121 -8029 -7891 -7869 -7721 -7718 -7695 -7676 -7648 -7624 -7589 -7479 -7429 -7420 -7355 -7330 -7321 -7309 -7265 -7168 -7165 -7160 -7121 -7004 -6907 -6901 -6885 -6769 -6756 -6750 -6740 -6725 -6706 -6690 -6661 -6652 -6600 -6497 -6412 -6407 -6269 -6260 -6246 -6245 -6206 -6179 -6163 -6113 -6108 -6064 -6053 -6030 -5937 -5918 -5883 -5859 -5853 -5717 -5667 -5603 -5592 -5527 -5517 -5440 -5438 -5414 -5362 -5361 -5320 -5292 -5226 -5216 -5088 -5076 -5063 -4999 -4861 -4714 -4604 -4581 -4392 -4328 -4307 -4278 -4235 -4083 -4001 -3897 -3859 -3846 -3792 -3748 -3732 -3695 -3634 -3593 -3584 -3518 -3502 -3495 -3466 -3444 -3418 -3371 -3328 -3325 -3310 -3244 -3200 -3127 -2940 -2907 -2750 -2691 -2682 -2670 -2626 -2529 -2516 -2470 -2423 -2421 -2363 -2359 -2324 -2297 -2217 -2113 -2102 -2035 -2032 -1999 -1979 -1964 -1936 -1876 -1846 -1809 -1663 -1642 -1636 -1609 -1602 -1570 -1473 -1463 -1300 -1257 -1217 -1211 -1030 -945 -843 -796 -647 -640 -595 -545 -536 -524 -424 -365 -340 -302 -294 -268 -244 -210 -206 -132 -57 63 109 140 156 243 254 296 312 318 368 378 427 504 568 634 675 688 752 764 788 903 919 1022 1113 1127 1343 1364 1425 1427 1442 1696 1919 2066 2200 2201 2289 2396 2414 2441 2449 2464 2647 2812 2894 2915 3054 3057 3209 3278 3280 3296 3455 3557 3567 3576 3623 3651 3800 3877 3902 4106 4167 4171 4215 4427 4441 4474 4601 4691 4696 4724 4853 4954 4967 5081 5118 5178 5289 5358 5393 5425 5487 5595 5602 5632 5711 5745 5795 6076 6092 6099 6388 6557 6599 6678 6785 6808 6867 6971 7220 7266 7331 7367 7369 7381 7458 7516 7676 7759 7892 8014 8168 8202 8223 8259 8528 8550 8596 8608 8786 8874 8905 8931 8989 9001 9042 9070 9325 9613 9620 9627 9638 9842 9931 9949
|
||||||
2
longest-increasing-subsequence-II/output/17
Normal file
2
longest-increasing-subsequence-II/output/17
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
330
|
||||||
|
-9944 -9942 -9914 -9907 -9880 -9861 -9806 -9657 -9529 -9506 -9500 -9440 -9380 -9288 -9208 -9172 -9164 -9144 -8771 -8768 -8692 -8648 -8601 -8480 -8417 -8357 -8130 -8125 -8115 -8110 -7961 -7910 -7785 -7729 -7726 -7694 -7663 -7546 -7529 -7460 -7437 -7430 -7376 -7267 -7214 -7045 -6993 -6966 -6876 -6863 -6669 -6520 -6483 -6394 -6340 -6277 -6159 -6039 -5980 -5810 -5766 -5730 -5662 -5553 -5505 -5420 -5381 -5269 -5210 -5093 -4923 -4914 -4907 -4905 -4796 -4736 -4556 -4548 -4467 -4377 -4337 -4317 -4306 -4295 -4225 -4194 -4187 -4154 -4087 -4068 -3990 -3946 -3943 -3912 -3876 -3858 -3696 -3687 -3658 -3605 -3560 -3544 -3486 -3386 -3334 -3328 -3321 -3282 -3231 -3177 -3165 -3123 -3048 -3047 -3029 -2782 -2673 -2563 -2507 -2489 -2405 -2365 -2170 -2012 -1997 -1686 -1524 -1521 -1503 -1425 -1397 -1302 -1257 -1224 -1135 -1056 -1048 -1016 -985 -824 -781 -725 -712 -611 -575 -568 -510 -413 -371 -295 -275 -197 -143 -116 -84 -38 72 122 128 156 179 239 290 308 357 398 417 486 518 564 684 834 844 954 1020 1081 1119 1233 1450 1528 1558 1569 1572 1687 1696 1796 1855 1874 1886 1900 2081 2119 2134 2180 2251 2316 2326 2405 2569 2572 2588 2644 2698 2708 2718 2780 2788 2799 2852 2980 3036 3042 3081 3086 3118 3165 3198 3214 3271 3301 3356 3422 3430 3636 3710 3713 3755 3908 3965 4266 4301 4493 4579 4584 4690 4774 4802 4867 4934 5106 5182 5280 5410 5425 5502 5511 5745 5854 5883 5919 5922 5952 6012 6023 6128 6222 6230 6259 6326 6381 6460 6470 6502 6538 6628 6684 6701 6766 6773 6835 6856 6930 6942 6961 6984 7144 7202 7254 7271 7298 7329 7341 7386 7458 7514 7534 7572 7655 7657 7754 7801 7802 7955 7996 8109 8238 8262 8275 8316 8403 8456 8513 8717 8725 8728 8797 8802 8818 8833 8866 8952 8954 8968 9041 9107 9231 9244 9256 9273 9288 9292 9303 9311 9434 9448 9548 9571 9585 9650 9836
|
||||||
2
longest-increasing-subsequence-II/output/18
Normal file
2
longest-increasing-subsequence-II/output/18
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
234
|
||||||
|
-9608 -9190 -8956 -8748 -8664 -8652 -8480 -8463 -8399 -8396 -8370 -8300 -8223 -8205 -8190 -8038 -8006 -7978 -7960 -7883 -7872 -7838 -7818 -7813 -7803 -7613 -7610 -7452 -7451 -7426 -7362 -7360 -7156 -7098 -7046 -7038 -7028 -7027 -7014 -6811 -6745 -6744 -6696 -6643 -6593 -6582 -6567 -6564 -6532 -6472 -6458 -6347 -6327 -6320 -6286 -5998 -5923 -5903 -5835 -5824 -5808 -5754 -5706 -5660 -5549 -5532 -5449 -5398 -5204 -5133 -5105 -4918 -4762 -4473 -4402 -4369 -4309 -4235 -3934 -3709 -3594 -3348 -3288 -3199 -3162 -2990 -2840 -2563 -2481 -2414 -2362 -2276 -2118 -2069 -2019 -1876 -1847 -1713 -1708 -1689 -1670 -1653 -1577 -1569 -1521 -1473 -1322 -1319 -1204 -1193 -1158 -1094 -1080 -995 -935 -907 -792 -749 -672 -594 -531 -439 -321 -187 179 323 557 577 688 689 728 823 1047 1277 1356 1408 1543 1558 1618 1664 1965 1980 1987 2119 2269 2345 2378 2383 2467 2677 2748 2853 3066 3331 3343 3391 3394 3578 3642 3663 3927 3929 3967 4104 4173 4420 4474 4508 4774 4927 4980 5010 5069 5149 5157 5309 5519 5558 5617 5935 6043 6085 6095 6096 6118 6138 6158 6195 6248 6286 6312 6394 6397 6546 6549 6628 6652 6715 6819 6836 6862 6879 6927 7156 7200 7231 7250 7430 7463 7513 7576 7578 7606 7710 7905 7910 7977 8038 8168 8360 8432 8473 8495 8883 8931 9119 9193 9244 9266 9290 9320 9417 9493 9758
|
||||||
2
longest-increasing-subsequence-II/output/19
Normal file
2
longest-increasing-subsequence-II/output/19
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
157
|
||||||
|
-9995 -9935 -9873 -9823 -9645 -9195 -8780 -8392 -8320 -8075 -8018 -7906 -7722 -7661 -7550 -7536 -7349 -7259 -7123 -7076 -6841 -6570 -6489 -6398 -6242 -5832 -5760 -5720 -5619 -5601 -5558 -5342 -5272 -5159 -4983 -4926 -4813 -4699 -4593 -4573 -4502 -4370 -4161 -3864 -3386 -3276 -3258 -3087 -3048 -2907 -2803 -2333 -2315 -2164 -2115 -1955 -1111 -1008 -1000 -757 -495 292 446 642 701 835 1100 1493 1578 1642 1755 1769 1777 1786 1874 1932 1970 2096 2130 2164 2288 2321 2324 2341 2511 2740 3126 3638 4028 4148 4333 4350 4380 4390 4402 4435 4472 4735 4832 4949 5175 5324 5457 5510 5557 5714 5788 5839 5874 5900 5930 6024 6075 6116 6432 6478 6528 6559 6683 6903 7022 7058 7250 7251 7399 7464 7475 7502 7518 7559 7773 7903 7977 8036 8363 8572 8639 8695 8791 8998 9008 9019 9057 9216 9236 9313 9361 9389 9407 9498 9538 9617 9761 9779 9789 9829 9840
|
||||||
2
longest-increasing-subsequence-II/output/2
Normal file
2
longest-increasing-subsequence-II/output/2
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
3
|
||||||
|
2 3 4
|
||||||
2
longest-increasing-subsequence-II/output/20
Normal file
2
longest-increasing-subsequence-II/output/20
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
374
|
||||||
|
-9998 -9995 -9988 -9978 -9953 -9932 -9877 -9848 -9826 -9754 -9635 -9586 -9569 -9507 -9464 -9444 -9383 -9373 -9341 -9306 -9280 -9252 -9243 -9192 -9111 -9105 -9104 -9094 -9050 -9025 -8992 -8965 -8963 -8932 -8837 -8731 -8721 -8660 -8598 -8567 -8464 -8448 -8446 -8441 -8393 -8259 -8160 -8151 -8095 -8045 -8016 -7954 -7913 -7858 -7838 -7773 -7718 -7598 -7573 -7469 -7466 -7406 -7273 -6888 -6819 -6558 -6548 -6500 -6488 -6371 -6350 -6054 -5916 -5892 -5833 -5823 -5808 -5750 -5696 -5622 -5550 -5391 -5371 -5349 -5160 -5056 -5006 -4907 -4827 -4812 -4662 -4633 -4541 -4531 -4506 -4388 -4358 -4332 -4326 -4088 -3998 -3957 -3941 -3927 -3865 -3736 -3711 -3566 -3557 -3401 -3206 -3174 -3167 -3075 -3037 -3036 -3030 -2913 -2852 -2827 -2811 -2718 -2638 -2625 -2603 -2584 -2239 -2212 -2193 -2182 -2063 -2059 -2040 -1963 -1909 -1805 -1744 -1698 -1677 -1656 -1478 -1381 -1378 -1130 -1124 -1054 -1052 -1006 -990 -972 -965 -807 -719 -697 -639 -621 -596 -503 -454 -433 -392 -348 -310 -303 -247 -127 -93 -50 -8 15 30 106 209 236 296 341 417 445 502 551 675 737 756 844 1042 1173 1221 1234 1248 1272 1312 1326 1380 1410 1426 1466 1535 1577 1586 1609 1658 1685 1718 1800 1839 1929 1972 2091 2194 2224 2227 2248 2263 2276 2292 2322 2325 2352 2390 2423 2571 2612 2617 2675 2705 2742 2743 2789 2842 2866 2932 2947 3011 3202 3211 3312 3343 3360 3369 3380 3488 3518 3548 3589 3599 3605 3633 3685 3769 3813 3954 4111 4160 4171 4180 4244 4303 4305 4339 4340 4345 4349 4355 4426 4428 4452 4460 4489 4502 4618 4652 4694 4697 4721 4780 4781 4816 4968 4985 4993 5001 5052 5054 5098 5134 5184 5246 5331 5367 5398 5406 5426 5523 5553 5572 5575 5602 5664 5717 5883 5967 6016 6101 6136 6238 6256 6278 6298 6310 6340 6411 6581 6599 6611 6642 6651 6666 6792 6803 6843 6860 6901 7023 7119 7245 7283 7310 7316 7430 7498 7601 7781 7897 7906 7991 8027 8087 8190 8334 8341 8349 8380 8462 8480 8557 8572 8605 8673 8685 8776 8782 8827 8830 8841 8913 8988 9067 9112 9119 9187 9222 9268 9275 9280 9299 9475 9476 9505 9605 9608 9651 9697 9777 9955
|
||||||
2
longest-increasing-subsequence-II/output/21
Normal file
2
longest-increasing-subsequence-II/output/21
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
507
|
||||||
|
-9982 -9928 -9909 -9802 -9776 -9761 -9713 -9652 -9637 -9632 -9630 -9609 -9608 -9554 -9444 -9357 -9282 -9278 -9277 -9226 -9220 -9187 -9179 -9178 -9067 -8971 -8969 -8968 -8940 -8930 -8913 -8842 -8837 -8797 -8783 -8719 -8644 -8620 -8547 -8508 -8479 -8429 -8384 -8318 -8293 -8229 -8200 -8185 -8175 -8156 -8118 -8095 -8046 -8030 -8013 -7970 -7965 -7956 -7937 -7907 -7810 -7800 -7781 -7750 -7737 -7736 -7696 -7663 -7570 -7534 -7517 -7510 -7489 -7482 -7461 -7441 -7386 -7379 -7340 -7298 -7289 -7279 -7268 -7222 -7193 -7123 -7114 -7073 -7048 -7001 -6964 -6895 -6821 -6755 -6713 -6712 -6688 -6539 -6514 -6502 -6462 -6421 -6406 -6373 -6332 -6256 -6236 -6232 -6168 -6134 -6130 -6073 -6069 -6014 -5979 -5925 -5912 -5902 -5901 -5864 -5823 -5805 -5787 -5729 -5721 -5629 -5600 -5539 -5457 -5455 -5323 -5286 -5211 -5204 -5196 -5177 -5140 -5135 -5078 -5004 -4967 -4929 -4892 -4736 -4731 -4712 -4688 -4668 -4524 -4520 -4513 -4497 -4449 -4386 -4348 -4337 -4336 -4306 -4281 -4268 -4267 -4257 -4239 -4229 -4223 -4219 -4200 -4159 -4151 -4133 -4083 -4077 -4025 -3988 -3921 -3897 -3879 -3856 -3849 -3837 -3803 -3782 -3710 -3680 -3652 -3651 -3640 -3631 -3616 -3597 -3559 -3528 -3491 -3478 -3442 -3391 -3265 -3094 -3040 -3010 -2961 -2870 -2833 -2792 -2739 -2713 -2659 -2605 -2597 -2541 -2528 -2457 -2376 -2192 -2176 -2171 -2122 -2121 -2093 -2047 -2039 -1983 -1956 -1940 -1937 -1912 -1871 -1822 -1742 -1716 -1707 -1682 -1651 -1641 -1610 -1604 -1593 -1546 -1496 -1492 -1469 -1450 -1439 -1402 -1371 -1359 -1334 -1278 -1274 -1226 -1199 -1164 -1128 -1125 -1107 -1072 -1022 -990 -887 -873 -838 -811 -768 -746 -740 -733 -678 -596 -571 -570 -522 -521 -512 -422 -421 -418 -337 -236 -227 -201 -191 -163 -135 -120 -84 -40 -26 20 30 42 107 108 128 213 271 289 345 350 352 367 390 462 579 598 643 646 699 740 834 902 926 934 946 963 1041 1064 1113 1136 1141 1229 1254 1467 1497 1617 1661 1733 1735 1750 1769 1851 1874 1879 1925 2008 2015 2052 2169 2229 2320 2326 2525 2616 2622 2637 2682 2725 2744 2754 2761 2787 2826 3001 3010 3032 3075 3103 3110 3129 3244 3318 3432 3506 3523 3546 3620 3651 3707 3767 3768 3807 3878 3890 3909 3946 4048 4050 4078 4122 4270 4480 4487 4588 4670 4680 4729 4834 4865 4921 5063 5107 5123 5128 5172 5173 5197 5237 5370 5516 5555 5568 5682 5689 5717 5748 5775 5776 5786 5789 5826 5835 5854 5860 5883 5977 5996 6035 6131 6153 6155 6294 6368 6447 6456 6457 6525 6526 6536 6546 6666 6710 6750 6759 6760 6762 6933 6983 7024 7035 7048 7161 7238 7268 7294 7366 7513 7601 7667 7676 7745 7753 7859 7990 8051 8229 8270 8284 8301 8383 8438 8461 8480 8498 8500 8514 8598 8614 8671 8705 8721 8734 8808 8828 8830 8851 8869 8883 8899 8915 8917 8963 8964 9025 9058 9092 9122 9137 9206 9211 9254 9262 9268 9286 9315 9348 9400 9478 9558 9559 9611 9770 9806 9845 9875 9886 9951 9992 9997
|
||||||
2
longest-increasing-subsequence-II/output/22
Normal file
2
longest-increasing-subsequence-II/output/22
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
349
|
||||||
|
-9911 -9878 -9863 -9829 -9640 -9631 -9587 -9558 -9528 -9491 -9381 -9359 -9341 -9307 -9285 -9192 -9059 -8971 -8945 -8911 -8901 -8767 -8673 -8641 -8614 -8585 -8574 -8510 -8405 -8403 -8353 -8324 -8304 -8264 -8224 -8176 -8138 -8121 -8109 -8053 -7989 -7966 -7806 -7801 -7769 -7746 -7712 -7696 -7687 -7578 -7456 -7446 -7418 -7373 -7363 -7308 -7256 -7214 -7200 -7183 -7128 -7104 -7064 -7033 -6974 -6956 -6873 -6856 -6731 -6694 -6663 -6651 -6648 -6498 -6359 -6293 -6275 -6175 -6150 -6078 -6018 -6017 -5921 -5873 -5800 -5776 -5648 -5611 -5513 -5254 -5051 -5019 -5010 -4999 -4966 -4733 -4693 -4684 -4681 -4624 -4542 -4486 -4394 -4367 -4363 -4351 -4187 -4155 -4119 -3990 -3869 -3623 -3596 -3541 -3539 -3522 -3309 -3308 -3270 -3206 -3152 -3105 -3038 -3014 -2939 -2902 -2864 -2781 -2760 -2717 -2664 -2616 -2571 -2490 -2457 -2396 -2300 -2289 -2274 -2251 -2247 -2184 -2127 -2125 -2113 -2045 -2001 -1945 -1928 -1841 -1828 -1752 -1739 -1603 -1589 -1524 -1493 -1462 -1441 -1352 -1332 -1195 -1165 -1153 -1150 -1124 -1096 -1078 -1074 -1072 -978 -974 -961 -840 -837 -780 -676 -594 -497 -478 -470 -451 -373 -346 -342 -274 -185 -157 -127 -75 50 151 200 284 454 513 582 623 688 754 777 780 829 835 857 875 917 923 957 1218 1241 1250 1253 1261 1263 1268 1393 1395 1408 1432 1437 1480 1614 1644 1658 1722 1745 1747 1784 1842 1863 1887 1896 1978 1985 2021 2045 2053 2105 2108 2124 2135 2266 2267 2350 2390 2421 2453 2470 2554 2578 2617 2732 2825 3024 3071 3109 3323 3396 3397 3422 3478 3560 3691 3817 3821 3823 3946 4128 4140 4151 4260 4289 4373 4406 4452 4462 4509 4516 4567 4711 4727 4787 4837 5017 5084 5147 5153 5176 5198 5222 5297 5314 5361 5395 5568 5583 5653 5662 5675 5685 5692 5771 5789 5814 5881 5882 5947 6187 6272 6373 6414 6454 6486 6613 6667 6878 7037 7043 7122 7242 7288 7298 7424 7685 7761 7799 7818 7881 7908 7963 8070 8102 8232 8261 8313 8764 8861 9044 9223 9245 9246 9547 9723 9794 9897 9898 9931 9938
|
||||||
2
longest-increasing-subsequence-II/output/23
Normal file
2
longest-increasing-subsequence-II/output/23
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
25
|
||||||
|
-6594 -3879 -2007 -1114 -897 -786 512 1882 2180 2814 3465 3747 3841 4032 5541 5646 5814 6188 6220 6275 6721 7143 7256 7405 7892
|
||||||
2
longest-increasing-subsequence-II/output/24
Normal file
2
longest-increasing-subsequence-II/output/24
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
372
|
||||||
|
-9907 -9754 -9463 -9281 -9261 -9208 -9189 -9164 -9146 -9111 -9031 -8907 -8806 -8749 -8670 -8557 -8518 -8449 -8415 -8360 -8236 -8201 -8177 -8106 -8009 -7946 -7926 -7912 -7883 -7851 -7850 -7826 -7779 -7741 -7701 -7665 -7483 -7479 -7417 -7330 -7318 -7288 -7234 -7160 -7148 -7084 -7080 -7059 -7051 -6992 -6863 -6799 -6748 -6738 -6727 -6721 -6688 -6597 -6582 -6568 -6567 -6532 -6516 -6510 -6466 -6459 -6435 -6432 -6343 -6313 -6279 -6241 -6223 -6145 -5948 -5879 -5861 -5698 -5684 -5665 -5655 -5644 -5616 -5599 -5591 -5587 -5584 -5541 -5458 -5401 -5383 -5334 -5295 -5283 -5266 -5233 -5124 -5112 -5086 -4950 -4852 -4839 -4807 -4755 -4650 -4604 -4587 -4574 -4563 -4520 -4478 -4352 -4340 -4324 -4238 -4222 -4169 -4150 -4082 -4053 -4018 -3808 -3652 -3633 -3560 -3555 -3477 -3244 -3128 -3105 -3066 -3023 -2987 -2975 -2951 -2752 -2727 -2669 -2658 -2654 -2602 -2519 -2370 -2367 -2327 -2324 -2263 -2215 -2185 -2140 -2072 -2022 -1903 -1849 -1750 -1734 -1669 -1661 -1447 -1381 -1339 -1334 -1275 -1233 -1177 -1109 -982 -980 -975 -936 -915 -893 -808 -705 -670 -549 -371 -338 -287 -192 -84 -80 -68 -2 10 109 292 377 413 438 604 607 630 665 698 743 817 874 888 920 933 972 1087 1120 1138 1152 1166 1211 1235 1263 1298 1327 1352 1415 1434 1456 1458 1641 1642 1706 1757 1779 1855 1915 1918 2008 2120 2180 2200 2207 2218 2219 2518 2627 2628 2671 2683 2726 2728 2789 2795 2918 2939 3037 3072 3128 3178 3231 3252 3255 3365 3417 3569 3628 3739 3745 3790 3945 4039 4122 4161 4169 4274 4306 4314 4323 4333 4375 4439 4459 4546 4567 4568 4641 4645 4697 4902 4989 5037 5158 5169 5220 5288 5405 5444 5488 5594 5619 5681 5700 5754 5901 5973 6074 6136 6157 6233 6251 6263 6267 6284 6359 6474 6500 6535 6599 6698 6736 6783 6828 6840 6891 7002 7003 7056 7062 7143 7156 7175 7301 7327 7346 7427 7504 7586 7605 7719 7783 7790 7823 7898 7916 7925 7962 7977 7991 8015 8098 8100 8119 8139 8265 8282 8323 8392 8433 8496 8642 8658 8677 8723 8738 8771 8915 9035 9072 9096 9173 9302 9310 9319 9332 9369 9407 9548 9553 9590 9592 9622 9650 9777 9949
|
||||||
2
longest-increasing-subsequence-II/output/25
Normal file
2
longest-increasing-subsequence-II/output/25
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
139
|
||||||
|
-9798 -9725 -9432 -8951 -8820 -8805 -8701 -8653 -8620 -8611 -8472 -8106 -8072 -8063 -7863 -7861 -7608 -7525 -6955 -6631 -6464 -6419 -6341 -6335 -6172 -6129 -6032 -5737 -5591 -5179 -5141 -5109 -5037 -4719 -4625 -4434 -4111 -3963 -3895 -3828 -3595 -3507 -3462 -3407 -3386 -3250 -3183 -2812 -2757 -2603 -2269 -2038 -1932 -1787 -1766 -1755 -1741 -1620 -1485 -1464 -1459 -1380 -1336 -1221 -1195 -1190 -1088 -1078 -623 -603 -506 -249 -87 167 189 354 401 491 706 815 883 928 941 947 1020 1085 1196 1314 1407 1415 1426 1482 1818 2170 2468 2812 2951 3041 3140 3158 3223 3362 3426 3525 3785 3920 4364 4507 4527 4569 4908 4921 5047 5223 5495 5620 6131 6211 6234 6339 6453 6694 6727 7032 7114 7177 7251 7735 8172 8807 9037 9186 9276 9348 9646 9708 9782 9830 9854
|
||||||
2
longest-increasing-subsequence-II/output/26
Normal file
2
longest-increasing-subsequence-II/output/26
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
481
|
||||||
|
-9974 -9955 -9887 -9878 -9842 -9828 -9781 -9554 -9422 -9290 -9256 -9253 -9019 -8956 -8932 -8919 -8843 -8724 -8696 -8652 -8647 -8533 -8484 -8458 -8368 -8357 -8288 -8245 -8216 -8171 -8149 -8148 -8088 -8067 -8006 -7992 -7866 -7834 -7713 -7680 -7623 -7614 -7596 -7593 -7589 -7513 -7477 -7468 -7444 -7431 -7413 -7342 -7282 -7240 -7211 -7198 -7145 -7123 -7122 -7059 -6995 -6965 -6918 -6842 -6833 -6802 -6708 -6631 -6625 -6620 -6608 -6546 -6494 -6465 -6462 -6438 -6417 -6392 -6252 -6208 -6197 -6152 -6117 -6055 -6048 -6043 -6027 -5984 -5940 -5854 -5833 -5808 -5728 -5706 -5636 -5608 -5518 -5500 -5454 -5376 -5337 -5322 -5310 -5200 -5194 -5120 -5093 -4975 -4974 -4966 -4943 -4932 -4919 -4900 -4809 -4628 -4503 -4495 -4456 -4345 -4328 -4300 -4232 -4196 -4131 -4125 -4005 -3966 -3875 -3829 -3802 -3720 -3715 -3683 -3621 -3529 -3526 -3514 -3503 -3494 -3464 -3455 -3436 -3404 -3393 -3382 -3378 -3319 -3317 -3301 -3260 -3248 -3196 -3190 -3120 -3030 -2937 -2926 -2919 -2914 -2871 -2807 -2794 -2667 -2635 -2615 -2492 -2482 -2293 -2271 -2234 -2126 -2083 -2082 -1981 -1965 -1945 -1871 -1747 -1738 -1724 -1645 -1586 -1531 -1424 -1422 -1407 -1384 -1382 -1328 -1174 -1070 -1057 -962 -930 -890 -802 -735 -734 -675 -631 -614 -504 -464 -375 -280 -248 -205 -160 -149 -85 -33 2 17 57 98 106 111 208 292 302 308 347 405 436 471 616 669 828 834 848 869 876 895 904 905 926 970 1030 1033 1044 1091 1118 1153 1177 1206 1281 1322 1411 1489 1502 1542 1624 1647 1733 1734 1796 1830 1840 1845 1973 1979 1984 2032 2082 2154 2175 2178 2209 2238 2280 2281 2287 2289 2310 2314 2316 2387 2470 2476 2548 2597 2631 2705 2759 2792 2803 2830 2889 2897 2935 3027 3053 3061 3172 3178 3228 3259 3317 3354 3382 3420 3423 3455 3486 3500 3510 3518 3567 3590 3650 3663 3667 3806 3898 3976 4012 4028 4052 4123 4164 4184 4213 4261 4287 4292 4363 4382 4385 4449 4491 4493 4547 4606 4633 4656 4720 4747 4749 4752 4811 4853 4862 4863 4879 4900 4952 5023 5050 5112 5236 5249 5276 5280 5287 5417 5431 5472 5485 5529 5532 5564 5572 5591 5635 5669 5693 5715 5756 5770 5808 5863 5892 5986 6005 6030 6058 6100 6102 6143 6184 6197 6208 6254 6263 6296 6322 6375 6423 6533 6561 6582 6589 6647 6648 6665 6706 6789 6816 6827 6896 6914 6926 6953 6979 6986 7010 7035 7112 7118 7122 7190 7206 7246 7269 7308 7331 7335 7347 7372 7427 7461 7492 7527 7632 7729 7742 7800 7963 7971 7996 8048 8088 8114 8121 8181 8199 8210 8239 8254 8414 8424 8489 8525 8531 8536 8559 8575 8689 8759 8851 8858 8873 8896 8905 8908 8909 8963 9033 9041 9067 9085 9254 9265 9281 9319 9405 9443 9444 9451 9468 9498 9533 9604 9732 9762 9807 9826 9888 9962 9976
|
||||||
2
longest-increasing-subsequence-II/output/27
Normal file
2
longest-increasing-subsequence-II/output/27
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
305
|
||||||
|
-9934 -9925 -9769 -9664 -9551 -9529 -9474 -9229 -9166 -9152 -9151 -9112 -9070 -8974 -8827 -8824 -8794 -8738 -8655 -8653 -8604 -8588 -8517 -8505 -8453 -8394 -8353 -8233 -8212 -8143 -8124 -8104 -8081 -8063 -8038 -7810 -7760 -7686 -7592 -7524 -7450 -7423 -7324 -7270 -7255 -7213 -7160 -7087 -7079 -7040 -7031 -7015 -6973 -6955 -6934 -6933 -6884 -6807 -6765 -6546 -6437 -6430 -6347 -6295 -6239 -6238 -6192 -6062 -6055 -6048 -6019 -5980 -5964 -5926 -5869 -5775 -5763 -5616 -5521 -5473 -5364 -5314 -5240 -5215 -5132 -5130 -4986 -4824 -4821 -4652 -4544 -4343 -4255 -4252 -4178 -4130 -4120 -3977 -3965 -3916 -3863 -3818 -3804 -3782 -3741 -3529 -3366 -3254 -3231 -3218 -2988 -2928 -2873 -2802 -2772 -2694 -2673 -2661 -2657 -2633 -2452 -2415 -2388 -2169 -2149 -2142 -1974 -1960 -1937 -1926 -1841 -1756 -1718 -1689 -1571 -1570 -1556 -1312 -1246 -1214 -1175 -1106 -1029 -947 -935 -870 -804 -770 -634 -612 -592 -441 -403 -336 -278 -268 -207 -150 -127 -55 7 13 100 101 149 187 307 411 426 451 572 591 655 691 749 809 873 881 966 1012 1048 1057 1130 1197 1246 1279 1305 1476 1611 1713 1732 1749 1802 1836 1873 1902 1946 2074 2078 2230 2242 2524 2574 2649 2710 2764 2929 3080 3208 3271 3277 3291 3306 3397 3665 3690 3752 3762 3776 3847 4016 4062 4173 4193 4424 4533 4539 4852 4861 4991 5285 5355 5399 5467 5534 5552 5676 5750 5779 5797 5902 5917 5992 5997 6111 6201 6253 6301 6322 6338 6560 6663 6673 6699 6788 6794 6895 6954 6973 6986 7184 7287 7291 7331 7344 7388 7424 7445 7591 7672 7716 7754 7861 7979 7993 8095 8174 8318 8320 8339 8395 8396 8415 8612 8613 8673 8871 8890 8906 8926 8957 8962 9039 9088 9191 9282 9346 9550 9551 9558 9777 9820 9876 9885 9909
|
||||||
2
longest-increasing-subsequence-II/output/28
Normal file
2
longest-increasing-subsequence-II/output/28
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
339
|
||||||
|
-9988 -9964 -9937 -9879 -9860 -9844 -9837 -9826 -9789 -9729 -9711 -9696 -9645 -9637 -9620 -9587 -9541 -9477 -9425 -9401 -9387 -9382 -9333 -9278 -9143 -9114 -9104 -9030 -9017 -8842 -8812 -8811 -8765 -8747 -8741 -8728 -8668 -8651 -8650 -8610 -8593 -8589 -8581 -8576 -8474 -8444 -8347 -8253 -8182 -8174 -8169 -8028 -8025 -7839 -7714 -7681 -7641 -7570 -7516 -7488 -7466 -7454 -7383 -7325 -7285 -7270 -7187 -7175 -7137 -7094 -7006 -6995 -6776 -6704 -6602 -6433 -6421 -6404 -6370 -6354 -6322 -6244 -6218 -6214 -6213 -6162 -6135 -5993 -5814 -5759 -5652 -5614 -5580 -5511 -5494 -5477 -5419 -5402 -5374 -5282 -5212 -5184 -5129 -5083 -4975 -4929 -4913 -4689 -4563 -4552 -4489 -4400 -4287 -4272 -4161 -4103 -3985 -3754 -3742 -3717 -3655 -3654 -3554 -3428 -3421 -3395 -3294 -3193 -3183 -3147 -3032 -2978 -2844 -2665 -2618 -2610 -2580 -2565 -2557 -2456 -2374 -2344 -2323 -2318 -2221 -2204 -2178 -1999 -1980 -1954 -1952 -1927 -1768 -1748 -1739 -1699 -1641 -1601 -1561 -1512 -1499 -1408 -1321 -1294 -1204 -1170 -1155 -1125 -1092 -1057 -970 -962 -943 -915 -758 -756 -755 -749 -709 -671 -623 -555 -451 -438 -407 -347 -289 -259 -247 -228 -204 -200 -128 -101 -85 -13 51 127 183 204 208 373 426 493 528 535 683 784 834 863 875 894 931 934 1096 1144 1167 1208 1248 1279 1368 1389 1435 1529 1734 1777 1800 1850 1852 2007 2196 2220 2257 2322 2374 2395 2445 2461 2464 2471 2482 2511 2523 2604 2613 2697 2899 3041 3192 3206 3367 3437 3516 3590 3598 3611 3618 3752 3877 3883 4020 4096 4169 4288 4317 4319 4358 4425 4629 4716 4736 4879 4895 5156 5190 5223 5234 5320 5345 5497 5520 5628 5660 5865 5870 5928 6024 6160 6191 6286 6291 6384 6398 6513 6542 6559 6613 6802 6826 6836 6895 6940 6958 6971 6989 7016 7071 7141 7373 7406 7419 7432 7504 7548 7691 7741 7798 7858 7907 7916 7956 7991 8034 8042 8064 8290 8331 8434 8667 8680 8697 8715 8783 8787 9123 9451 9490 9630 9775
|
||||||
2
longest-increasing-subsequence-II/output/29
Normal file
2
longest-increasing-subsequence-II/output/29
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
152
|
||||||
|
-9935 -9851 -9801 -9794 -9783 -9782 -9773 -9547 -9340 -9208 -9165 -9078 -9052 -8934 -8886 -8744 -8703 -8317 -8290 -8244 -8081 -7836 -7761 -7712 -7643 -7609 -7525 -7496 -7201 -7191 -7180 -7129 -7083 -6724 -6651 -6635 -6397 -6372 -6235 -6098 -5975 -5946 -5840 -5806 -5739 -5617 -5569 -5540 -5489 -5130 -5124 -4706 -4647 -4512 -4510 -4156 -3985 -3869 -3830 -3415 -3208 -3078 -3054 -2820 -2804 -2631 -2495 -2172 -2083 -1985 -1869 -1474 -1368 -1343 -1268 -1218 -1074 -1054 -825 -727 -507 -482 -444 -396 -330 18 133 174 257 281 330 451 510 722 811 1181 1265 1419 1567 1582 1606 1636 1954 2022 2175 2319 2321 2396 2424 2794 3026 3428 3478 3516 3521 3733 3745 3833 4161 4164 4165 4188 4443 4809 4819 4871 5088 5498 5556 5707 6175 6435 6496 6664 6819 7269 7312 7318 7398 7499 7793 7820 7856 8027 8305 8529 8700 8956 9155 9287 9490 9887
|
||||||
2
longest-increasing-subsequence-II/output/3
Normal file
2
longest-increasing-subsequence-II/output/3
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
1
|
||||||
|
0
|
||||||
2
longest-increasing-subsequence-II/output/30
Normal file
2
longest-increasing-subsequence-II/output/30
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
560
|
||||||
|
-9914 -9876 -9846 -9840 -9803 -9783 -9767 -9718 -9641 -9534 -9514 -9433 -9392 -9378 -9369 -9356 -9333 -9330 -9324 -9317 -9301 -9278 -9262 -9251 -9250 -9241 -9233 -9218 -9215 -9200 -9198 -9177 -9166 -9164 -9080 -9055 -9049 -9015 -8993 -8944 -8940 -8925 -8862 -8807 -8802 -8767 -8714 -8708 -8702 -8700 -8693 -8652 -8648 -8637 -8618 -8586 -8565 -8539 -8511 -8474 -8467 -8464 -8438 -8430 -8427 -8325 -8283 -8230 -8216 -8207 -8115 -8083 -8018 -7970 -7932 -7826 -7700 -7662 -7657 -7585 -7555 -7553 -7438 -7425 -7400 -7351 -7339 -7286 -7236 -7095 -6992 -6946 -6919 -6915 -6897 -6896 -6842 -6781 -6707 -6665 -6663 -6661 -6657 -6651 -6649 -6641 -6598 -6548 -6479 -6449 -6444 -6376 -6373 -6320 -6287 -6279 -6274 -6185 -6160 -6143 -6138 -6119 -6085 -6027 -5992 -5991 -5974 -5968 -5946 -5907 -5884 -5876 -5872 -5868 -5776 -5772 -5757 -5713 -5644 -5642 -5627 -5543 -5524 -5493 -5487 -5471 -5468 -5453 -5366 -5364 -5323 -5314 -5248 -5184 -5096 -5069 -5010 -4995 -4800 -4779 -4750 -4629 -4594 -4562 -4560 -4535 -4510 -4486 -4460 -4309 -4275 -4249 -4142 -4090 -4053 -4004 -3984 -3961 -3924 -3913 -3901 -3887 -3835 -3827 -3820 -3758 -3729 -3708 -3679 -3620 -3562 -3541 -3511 -3432 -3415 -3359 -3268 -3189 -3148 -3127 -2954 -2953 -2910 -2909 -2872 -2860 -2824 -2822 -2798 -2746 -2725 -2673 -2642 -2631 -2586 -2573 -2437 -2433 -2383 -2357 -2307 -2258 -2217 -2151 -2110 -2083 -2003 -1971 -1953 -1943 -1897 -1864 -1845 -1831 -1821 -1751 -1741 -1635 -1597 -1533 -1426 -1424 -1401 -1372 -1347 -1329 -1312 -1288 -1268 -1257 -1200 -1186 -1176 -1175 -1162 -1158 -1145 -1091 -1072 -1060 -1042 -931 -837 -795 -789 -780 -760 -743 -722 -646 -631 -589 -570 -543 -535 -510 -464 -393 -278 -272 -249 -243 -204 -199 -185 -147 -108 -92 -23 34 45 98 131 162 163 170 174 182 194 239 332 362 396 437 445 509 518 613 641 643 756 812 842 945 959 986 999 1101 1153 1194 1196 1253 1268 1290 1383 1462 1539 1557 1672 1685 1700 1738 1748 1774 1853 1866 1880 1881 1902 1953 1977 2008 2040 2073 2195 2203 2226 2235 2270 2279 2286 2294 2298 2301 2304 2328 2349 2395 2408 2411 2440 2445 2485 2497 2506 2530 2531 2536 2537 2562 2600 2619 2635 2679 2760 2830 2869 2876 2884 2915 2930 2943 2955 2964 2976 2979 3016 3058 3090 3123 3159 3176 3234 3236 3238 3259 3293 3350 3366 3404 3466 3489 3492 3517 3532 3536 3539 3595 3606 3615 3636 3672 3764 3767 3862 3870 3876 3885 3888 3935 3938 3954 3971 3979 4072 4123 4181 4185 4201 4226 4248 4250 4274 4401 4440 4490 4556 4563 4581 4611 4618 4623 4656 4689 4699 4712 4733 4852 4945 4959 4998 5004 5020 5022 5046 5057 5142 5249 5291 5292 5295 5364 5380 5407 5453 5522 5545 5580 5654 5709 5794 5822 5870 5874 5892 5905 5907 5952 5984 5993 6017 6057 6060 6105 6202 6224 6247 6310 6311 6315 6371 6412 6462 6467 6489 6490 6531 6541 6589 6655 6676 6815 6856 6888 6919 6944 6954 7136 7188 7225 7326 7392 7405 7490 7499 7511 7521 7551 7584 7594 7763 7768 7925 7987 8046 8049 8142 8181 8329 8360 8373 8384 8392 8543 8640 8664 8715 8764 8845 8897 8912 8976 9015 9043 9058 9069 9083 9089 9267 9273 9341 9376 9422 9486 9494 9499 9541 9593 9614 9948
|
||||||
2
longest-increasing-subsequence-II/output/31
Normal file
2
longest-increasing-subsequence-II/output/31
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
551
|
||||||
|
-9935 -9930 -9911 -9906 -9827 -9809 -9782 -9775 -9771 -9753 -9728 -9705 -9689 -9627 -9598 -9558 -9545 -9501 -9454 -9444 -9421 -9414 -9410 -9400 -9399 -9283 -9281 -9199 -9170 -9113 -9108 -9090 -9081 -9079 -9071 -9066 -9008 -8983 -8971 -8949 -8946 -8930 -8870 -8825 -8620 -8569 -8523 -8458 -8402 -8380 -8365 -8290 -8220 -8198 -8174 -8172 -8150 -8083 -8018 -8001 -7988 -7844 -7838 -7827 -7824 -7783 -7703 -7662 -7614 -7612 -7576 -7539 -7479 -7413 -7397 -7279 -7239 -7123 -7110 -7076 -7053 -7011 -6992 -6984 -6965 -6946 -6929 -6923 -6893 -6878 -6870 -6850 -6845 -6760 -6759 -6744 -6704 -6657 -6645 -6588 -6554 -6488 -6478 -6396 -6312 -6309 -6297 -6257 -6208 -6178 -6172 -6138 -6041 -6038 -6035 -6034 -5995 -5945 -5904 -5853 -5697 -5682 -5615 -5589 -5571 -5535 -5500 -5497 -5487 -5485 -5400 -5285 -5273 -5228 -5181 -5092 -5063 -4954 -4936 -4908 -4889 -4859 -4766 -4756 -4721 -4720 -4641 -4640 -4634 -4629 -4606 -4604 -4573 -4542 -4510 -4498 -4483 -4444 -4393 -4388 -4385 -4374 -4354 -4344 -4325 -4269 -4237 -4157 -4067 -4045 -4038 -3986 -3934 -3921 -3885 -3854 -3784 -3725 -3672 -3669 -3639 -3558 -3538 -3512 -3499 -3492 -3452 -3439 -3431 -3405 -3398 -3383 -3358 -3356 -3285 -3155 -3153 -3142 -3020 -2985 -2963 -2957 -2934 -2922 -2824 -2787 -2770 -2733 -2714 -2636 -2585 -2492 -2469 -2429 -2427 -2417 -2413 -2370 -2369 -2335 -2328 -2325 -2262 -2253 -2250 -2248 -2187 -2048 -2042 -2041 -2004 -1974 -1949 -1948 -1882 -1876 -1856 -1819 -1766 -1744 -1681 -1637 -1615 -1608 -1559 -1541 -1480 -1479 -1442 -1217 -1207 -1119 -1099 -1094 -1052 -1017 -1010 -997 -969 -947 -925 -915 -908 -870 -830 -810 -783 -763 -762 -747 -744 -620 -555 -498 -478 -442 -428 -424 -410 -407 -404 -390 -349 -328 -307 -270 -207 -167 -166 -143 -131 -120 -116 -78 -77 -45 50 173 183 184 288 294 310 350 353 378 405 440 497 543 580 603 618 647 649 688 713 726 794 869 903 915 992 995 1010 1032 1038 1116 1143 1178 1191 1197 1217 1256 1257 1296 1315 1380 1397 1398 1458 1465 1473 1488 1508 1549 1590 1599 1660 1664 1718 1734 1741 1754 1775 1952 2001 2028 2065 2112 2119 2128 2159 2177 2227 2238 2283 2297 2308 2334 2346 2368 2449 2523 2541 2583 2653 2679 2701 2733 2777 2789 2957 2981 2998 3000 3059 3074 3101 3152 3182 3189 3222 3227 3249 3309 3346 3365 3396 3428 3465 3505 3523 3577 3619 3642 3659 3722 3727 3793 3867 3912 3953 3960 4145 4204 4260 4309 4419 4426 4452 4495 4657 4668 4750 4814 4848 4862 4915 5031 5049 5087 5117 5208 5224 5226 5235 5239 5240 5260 5266 5310 5419 5480 5537 5644 5696 5713 5777 5804 5805 5816 5850 5863 5868 5872 5883 5958 6023 6056 6077 6113 6128 6175 6207 6299 6329 6388 6397 6399 6402 6416 6441 6473 6488 6491 6555 6640 6642 6778 6800 6849 6851 6864 6871 6891 6908 7043 7092 7095 7146 7201 7213 7237 7418 7436 7438 7467 7578 7632 7633 7684 7727 7765 7778 7787 7796 7823 7827 7896 7898 7899 7901 7993 8001 8021 8048 8095 8125 8128 8147 8218 8222 8268 8407 8468 8541 8630 8699 8799 8879 8974 9049 9060 9064 9080 9205 9209 9353 9391 9441 9451 9472 9560 9586 9604 9660 9694 9785 9820 9840
|
||||||
2
longest-increasing-subsequence-II/output/32
Normal file
2
longest-increasing-subsequence-II/output/32
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
491
|
||||||
|
-9989 -9917 -9906 -9905 -9903 -9899 -9856 -9826 -9819 -9564 -9490 -9434 -9402 -9397 -9390 -9365 -9264 -9229 -9193 -9189 -9097 -9016 -8974 -8857 -8852 -8827 -8714 -8647 -8637 -8582 -8511 -8493 -8463 -8426 -8379 -8249 -8227 -8220 -8161 -8135 -8122 -8106 -8088 -8044 -8028 -8024 -7900 -7821 -7752 -7743 -7642 -7585 -7524 -7523 -7329 -7323 -7287 -7277 -7247 -7237 -7217 -7169 -7138 -7029 -6969 -6921 -6911 -6773 -6745 -6664 -6540 -6530 -6437 -6418 -6413 -6357 -6312 -6303 -6262 -6186 -6172 -6138 -6127 -5949 -5915 -5909 -5889 -5626 -5602 -5601 -5571 -5566 -5537 -5498 -5485 -5287 -5270 -5225 -5141 -5094 -5075 -5046 -4944 -4819 -4800 -4795 -4713 -4701 -4682 -4587 -4583 -4553 -4541 -4537 -4524 -4513 -4494 -4396 -4270 -4259 -4171 -4139 -4096 -4065 -4049 -4028 -4023 -3939 -3929 -3914 -3866 -3805 -3727 -3715 -3669 -3659 -3654 -3427 -3379 -3375 -3338 -3237 -3235 -3223 -3139 -3133 -3123 -3083 -3056 -2971 -2925 -2899 -2896 -2741 -2730 -2705 -2642 -2631 -2587 -2572 -2524 -2491 -2475 -2472 -2470 -2367 -2310 -2239 -2215 -2120 -2114 -2092 -2087 -1991 -1954 -1906 -1893 -1880 -1717 -1689 -1665 -1646 -1633 -1618 -1498 -1443 -1423 -1364 -1354 -1264 -1246 -1243 -1172 -1052 -1016 -977 -929 -889 -867 -808 -781 -758 -735 -729 -638 -573 -498 -393 -381 -318 -309 -304 -294 -206 -172 -110 -96 -84 -72 -7 1 32 56 105 126 127 147 195 334 347 361 376 429 458 500 514 521 563 579 589 593 639 655 698 708 748 752 760 784 807 940 956 969 1026 1059 1064 1108 1129 1177 1244 1270 1277 1355 1358 1379 1483 1485 1564 1596 1636 1638 1641 1652 1674 1675 1731 1736 1818 1846 1949 1977 1993 1998 2062 2123 2176 2209 2220 2281 2332 2366 2381 2411 2427 2473 2486 2508 2534 2564 2592 2594 2622 2647 2742 2758 2772 2797 2798 2860 2888 2893 2901 2907 2913 2914 2936 2952 3003 3015 3070 3082 3083 3133 3238 3277 3311 3381 3402 3415 3480 3530 3597 3621 3652 3672 3756 3908 3963 4008 4048 4051 4080 4088 4097 4193 4228 4295 4311 4320 4329 4366 4391 4405 4412 4419 4436 4481 4573 4591 4652 4711 4729 4735 4776 4779 4788 4814 4871 4874 4906 4937 4980 4995 5019 5091 5100 5101 5249 5251 5261 5281 5342 5352 5400 5423 5439 5448 5450 5509 5594 5674 5769 5789 5790 5799 5978 5993 6019 6067 6219 6326 6390 6432 6435 6442 6599 6631 6643 6764 6854 6968 6972 7178 7255 7408 7412 7436 7527 7606 7667 7692 7791 7793 7815 7819 7855 7859 7875 7948 7967 7984 8041 8130 8237 8244 8361 8372 8446 8459 8475 8500 8600 8697 8736 8753 8782 8842 8844 8866 8874 8882 8903 8937 8939 8999 9019 9030 9038 9053 9068 9085 9107 9128 9129 9157 9169 9171 9177 9198 9243 9281 9301 9338 9339 9368 9380 9451 9476 9501 9556 9631 9657 9669 9714 9742 9801 9836 9860 9864 9866 9872
|
||||||
2
longest-increasing-subsequence-II/output/33
Normal file
2
longest-increasing-subsequence-II/output/33
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
319
|
||||||
|
-9920 -9876 -9826 -9799 -9794 -9781 -9666 -9606 -9424 -9258 -8731 -8708 -8700 -8661 -8626 -8542 -8469 -8216 -8214 -8175 -8128 -8090 -8035 -7854 -7807 -7759 -7754 -7717 -7240 -7083 -7078 -6809 -6717 -6520 -6471 -6433 -6242 -6218 -6215 -6204 -6176 -6062 -5904 -5857 -5750 -5733 -5692 -5619 -5586 -5102 -4981 -4920 -4888 -4829 -4667 -4639 -4636 -4543 -4407 -4317 -4316 -4291 -4258 -4253 -4229 -4193 -4098 -4035 -3941 -3909 -3893 -3883 -3856 -3792 -3729 -3712 -3611 -3515 -3481 -3457 -3399 -3362 -3361 -3279 -3201 -3086 -2982 -2938 -2900 -2897 -2782 -2781 -2758 -2709 -2589 -2575 -2574 -2565 -2542 -2388 -2362 -2264 -2214 -2083 -2078 -1979 -1969 -1903 -1847 -1841 -1607 -1569 -1521 -1257 -1242 -1162 -1116 -1103 -998 -904 -883 -595 -536 -499 -382 -324 -122 -73 -65 -10 60 208 255 283 303 475 553 576 664 680 708 785 788 875 892 927 1098 1114 1140 1148 1215 1254 1341 1394 1406 1425 1435 1527 1724 1784 1836 1886 1913 2048 2133 2253 2260 2399 2492 2497 2524 2590 2640 2652 2724 2772 2786 2842 3029 3043 3069 3080 3084 3112 3155 3241 3311 3456 3677 3756 4154 4165 4168 4183 4189 4198 4211 4221 4239 4415 4430 4492 4495 4514 4526 4540 4551 4675 4700 4717 4760 4823 4829 4837 4866 4869 4878 4935 4998 5148 5212 5224 5274 5318 5333 5341 5352 5363 5412 5425 5456 5475 5483 5486 5535 5564 5568 5630 5697 5740 5801 5843 5851 5952 6121 6124 6179 6357 6365 6422 6637 6744 6777 6792 6877 6909 6913 6987 6999 7009 7013 7052 7057 7120 7167 7192 7266 7361 7405 7480 7607 7693 7718 7802 7917 8047 8048 8103 8203 8224 8273 8307 8320 8366 8424 8477 8508 8510 8552 8566 8569 8721 8775 8899 8928 8967 8992 9020 9195 9213 9230 9392 9498 9556 9586 9608 9669 9700 9707 9765 9779 9838 9859 9860 9877 9899 9903 9909 9973
|
||||||
2
longest-increasing-subsequence-II/output/34
Normal file
2
longest-increasing-subsequence-II/output/34
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
463
|
||||||
|
-9993 -9992 -9954 -9950 -9895 -9850 -9702 -9690 -9678 -9659 -9655 -9563 -9543 -9525 -9471 -9463 -9223 -9112 -8999 -8995 -8987 -8971 -8902 -8896 -8866 -8864 -8858 -8857 -8697 -8680 -8649 -8629 -8627 -8566 -8371 -8365 -8355 -8353 -8314 -8269 -8241 -8193 -8164 -8150 -8030 -7880 -7855 -7806 -7630 -7628 -7589 -7364 -7358 -7281 -7275 -7239 -7112 -7108 -7041 -7037 -7035 -7025 -6998 -6984 -6929 -6910 -6860 -6827 -6811 -6810 -6769 -6493 -6375 -6231 -6207 -6203 -6148 -6114 -6096 -6093 -6071 -6058 -6034 -5863 -5862 -5800 -5690 -5674 -5651 -5623 -5498 -5471 -5377 -5337 -5322 -5305 -5284 -5278 -5245 -5196 -5178 -5162 -5159 -5033 -4902 -4838 -4827 -4805 -4712 -4623 -4610 -4591 -4583 -4465 -4436 -4405 -4315 -4129 -4121 -4107 -4098 -4071 -4038 -4001 -3856 -3784 -3755 -3752 -3703 -3648 -3643 -3625 -3615 -3591 -3575 -3536 -3386 -3380 -3377 -3362 -3319 -3283 -3238 -3138 -3117 -3074 -3046 -2946 -2927 -2919 -2894 -2774 -2715 -2700 -2683 -2677 -2631 -2579 -2545 -2539 -2533 -2510 -2493 -2413 -2396 -2288 -2251 -2149 -2103 -2080 -2036 -2030 -1899 -1895 -1879 -1867 -1830 -1820 -1741 -1623 -1574 -1559 -1517 -1483 -1472 -1469 -1358 -1273 -1218 -1215 -1195 -1157 -1126 -1058 -993 -790 -789 -785 -744 -719 -608 -574 -479 -477 -456 -429 -405 -368 -266 -221 -189 -182 -116 -87 -47 27 58 87 119 142 193 223 238 259 261 290 383 398 455 490 538 746 797 905 948 1000 1034 1121 1146 1167 1197 1226 1270 1287 1332 1437 1452 1481 1485 1640 1715 1721 1761 1861 1917 1918 1931 1957 1971 1981 2050 2123 2246 2262 2294 2296 2373 2398 2412 2415 2420 2426 2461 2464 2476 2516 2543 2597 2604 2795 2800 2829 2878 2890 2979 3043 3065 3074 3133 3168 3348 3403 3540 3559 3638 3654 3695 3789 3802 3803 3854 3893 3974 4054 4192 4253 4330 4373 4452 4462 4499 4505 4516 4588 4635 4709 4763 4809 4895 4896 4931 4936 5074 5084 5101 5110 5252 5309 5332 5344 5393 5403 5423 5435 5461 5499 5553 5575 5589 5687 5707 5869 5916 5928 5948 5949 5964 5978 6043 6053 6054 6133 6172 6278 6284 6331 6482 6487 6519 6573 6612 6662 6708 6714 6772 6789 6817 6875 6953 6992 6995 7010 7039 7064 7080 7147 7157 7169 7207 7215 7384 7388 7431 7485 7520 7530 7580 7611 7613 7644 7715 7724 7747 7804 7834 7861 7873 7922 7946 7947 8000 8092 8098 8120 8146 8169 8183 8213 8242 8250 8273 8353 8372 8426 8468 8490 8496 8562 8601 8646 8684 8728 8748 8753 8764 8770 8780 8837 8874 8875 8902 8911 8970 8977 9036 9090 9219 9292 9326 9329 9365 9409 9413 9463 9499 9505 9582 9593 9594 9607 9668 9684 9687 9702 9734 9752 9778 9785 9806 9810 9848 9903 9905
|
||||||
2
longest-increasing-subsequence-II/output/35
Normal file
2
longest-increasing-subsequence-II/output/35
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
232
|
||||||
|
-9992 -9946 -9859 -9856 -9849 -9838 -9685 -9634 -9594 -9536 -9534 -9521 -9468 -9349 -9248 -9237 -9068 -8956 -8835 -8825 -8679 -8539 -8416 -8341 -8280 -8228 -8142 -8080 -8073 -8059 -7973 -7822 -7794 -7752 -7622 -7514 -7464 -7203 -7157 -7109 -7066 -7050 -7028 -6987 -6890 -6874 -6835 -6641 -6567 -6533 -6439 -6261 -6134 -5984 -5943 -5898 -5840 -5699 -5610 -5594 -5565 -5545 -5428 -5401 -5395 -5355 -5354 -5266 -5216 -5037 -4965 -4786 -4757 -4524 -4520 -4441 -4429 -4331 -4134 -4078 -3991 -3958 -3863 -3856 -3833 -3828 -3735 -3732 -3577 -3506 -3304 -3294 -3227 -3220 -3200 -3157 -3009 -2987 -2962 -2894 -2849 -2845 -2808 -2756 -2737 -2721 -2647 -2548 -2478 -2415 -2336 -2155 -2005 -1951 -1921 -1886 -1851 -1740 -1707 -1642 -1626 -1486 -1456 -1376 -1373 -1340 -1269 -1256 -1251 -1233 -1182 -1181 -1177 -1048 -979 -973 -969 -867 -825 -682 -667 -522 -374 -309 -64 6 122 218 372 455 459 916 1155 1176 1199 1596 1685 1692 1739 1747 1779 1838 2055 2461 2665 2749 2787 2837 3087 3124 3244 3315 3488 3534 3584 3709 3817 3842 3879 4066 4176 4332 4357 4571 4614 4837 5062 5090 5378 5725 5739 6040 6090 6113 6185 6211 6342 6365 6416 6623 6657 6845 6941 7067 7381 7439 7521 7590 7628 7832 7866 8282 8382 8619 8674 8680 9013 9039 9122 9234 9321 9495 9571 9599 9643 9851 9862 9884 9896 9906 9953 9987
|
||||||
2
longest-increasing-subsequence-II/output/36
Normal file
2
longest-increasing-subsequence-II/output/36
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
1
|
||||||
|
-10000
|
||||||
2
longest-increasing-subsequence-II/output/37
Normal file
2
longest-increasing-subsequence-II/output/37
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
1
|
||||||
|
10000
|
||||||
2
longest-increasing-subsequence-II/output/4
Normal file
2
longest-increasing-subsequence-II/output/4
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
1
|
||||||
|
-10000
|
||||||
2
longest-increasing-subsequence-II/output/5
Normal file
2
longest-increasing-subsequence-II/output/5
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
1
|
||||||
|
-1
|
||||||
2
longest-increasing-subsequence-II/output/6
Normal file
2
longest-increasing-subsequence-II/output/6
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
334
|
||||||
|
-9994 -9939 -9920 -9841 -9758 -9726 -9721 -9671 -9491 -9459 -9456 -9393 -9180 -9143 -8900 -8824 -8816 -8799 -8745 -8738 -8648 -8565 -8562 -8427 -8250 -8097 -7794 -7770 -7713 -7671 -7590 -7324 -7241 -7230 -7145 -6971 -6962 -6883 -6877 -6766 -6689 -6634 -6630 -6450 -6446 -6415 -6286 -6219 -6188 -6121 -5990 -5941 -5874 -5857 -5759 -5553 -5496 -5301 -5274 -5272 -5029 -4962 -4870 -4838 -4798 -4796 -4744 -4697 -4680 -4653 -4622 -4600 -4588 -4584 -4573 -4564 -4506 -4478 -4434 -4390 -4349 -4338 -4165 -4137 -4062 -4058 -4041 -4024 -3961 -3761 -3754 -3662 -3628 -3613 -3564 -3544 -3543 -3539 -3498 -3468 -3409 -3402 -3359 -3178 -3064 -3002 -2967 -2890 -2882 -2879 -2853 -2810 -2702 -2662 -2567 -2537 -2531 -2473 -2449 -2447 -2433 -2387 -2373 -2299 -2124 -2111 -2031 -1986 -1981 -1911 -1901 -1749 -1640 -1602 -1600 -1541 -1507 -1477 -1409 -1352 -1297 -1295 -1166 -1151 -1148 -1134 -1079 -1075 -1069 -961 -902 -890 -873 -829 -823 -798 -727 -689 -587 -507 -427 -385 -347 -256 -245 -244 -221 -150 -84 128 178 209 297 385 485 520 578 723 778 790 800 963 966 985 1012 1154 1181 1220 1314 1344 1391 1405 1474 1626 1813 1878 2000 2134 2163 2186 2344 2346 2361 2364 2544 2582 2591 2721 2745 2810 2907 2912 2928 2943 2967 2972 3026 3035 3142 3151 3200 3212 3221 3233 3387 3424 3470 3509 3528 3556 3709 3810 4058 4187 4206 4255 4342 4344 4360 4372 4442 4547 4617 4622 4625 4697 4728 4860 4868 4910 4995 5051 5130 5250 5270 5284 5288 5304 5394 5474 5580 5614 5709 5781 5817 5818 5943 6122 6148 6170 6205 6218 6552 6615 6796 6961 7006 7067 7128 7165 7338 7347 7426 7503 7520 7626 7788 7789 7874 7927 7964 8012 8021 8025 8076 8175 8225 8263 8338 8376 8438 8478 8551 8594 8602 8755 8877 8881 8937 8972 8998 9046 9050 9085 9118 9147 9343 9347 9408 9409 9503 9507 9530 9550 9651 9658 9666 9706 9727 9740 9760 9807 9815 9906
|
||||||
2
longest-increasing-subsequence-II/output/7
Normal file
2
longest-increasing-subsequence-II/output/7
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
295
|
||||||
|
-9997 -9838 -9645 -9615 -9359 -9147 -9017 -8940 -8907 -8796 -8783 -8773 -8537 -8354 -8314 -8258 -8221 -8218 -8162 -8107 -8017 -7898 -7883 -7850 -7837 -7801 -7731 -7728 -7691 -7640 -7454 -7349 -7308 -7176 -7123 -7087 -7058 -7011 -6991 -6901 -6900 -6881 -6555 -6396 -6392 -6375 -6367 -6323 -6214 -6162 -6112 -6090 -6087 -6065 -6030 -5989 -5717 -5646 -5487 -5475 -5332 -5257 -5239 -5208 -5111 -5070 -4985 -4929 -4924 -4914 -4879 -4796 -4719 -4712 -4698 -4588 -4509 -4482 -4462 -4402 -4379 -4334 -4224 -4116 -4096 -4095 -3952 -3851 -3786 -3629 -3487 -3399 -3099 -3018 -2968 -2955 -2854 -2803 -2783 -2674 -2670 -2568 -2457 -2346 -2313 -2279 -2270 -2200 -2166 -2063 -1992 -1867 -1805 -1778 -1765 -1579 -1564 -1510 -1464 -1383 -1246 -1200 -1163 -1118 -985 -983 -946 -932 -887 -871 -776 -766 -760 -744 -715 -714 -614 -561 -479 -471 -441 -413 -289 -276 -233 -104 -96 -89 43 222 366 451 468 502 583 710 775 780 919 936 959 989 995 1070 1103 1183 1304 1370 1371 1400 1740 1743 1789 1900 1924 2014 2111 2125 2175 2220 2264 2302 2411 2416 2482 2651 2679 2718 2724 2777 2795 2868 2885 2901 3064 3103 3112 3175 3219 3356 3388 3433 3451 3529 3578 3702 3736 3740 3923 4015 4109 4295 4318 4382 4411 4500 4545 4685 4775 4797 4894 4996 5156 5340 5356 5373 5388 5429 5734 5794 5832 5854 5862 6071 6073 6201 6311 6388 6411 6439 6448 6476 6490 6508 6757 6764 6785 7055 7419 7428 7437 7457 7481 7541 7597 7761 7846 7878 7895 7942 7971 7999 8006 8018 8081 8100 8112 8131 8295 8381 8504 8544 8668 8716 8721 8804 8960 8998 9016 9085 9180 9223 9252 9325 9375 9481 9512 9561 9568 9576 9591 9609 9626 9685 9766
|
||||||
2
longest-increasing-subsequence-II/output/8
Normal file
2
longest-increasing-subsequence-II/output/8
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
159
|
||||||
|
-9994 -9680 -9662 -9600 -9559 -9530 -9455 -9407 -9182 -9172 -8984 -8923 -8841 -8793 -8714 -8665 -8606 -8376 -8341 -8216 -8167 -8124 -8114 -8105 -8080 -7950 -7770 -7704 -7567 -7519 -7450 -7427 -7387 -7331 -7140 -6898 -6691 -6621 -6496 -6475 -6267 -6102 -5847 -5843 -5790 -5712 -5319 -5160 -5067 -4949 -4892 -4699 -4634 -4572 -4368 -4323 -4251 -3924 -3915 -3748 -3671 -3433 -3157 -3119 -2981 -2931 -2907 -2765 -2669 -2033 -1823 -1531 -1335 -1194 -919 -825 -731 -458 -346 -304 -282 94 369 378 420 428 689 865 919 1011 1020 1109 1288 1392 1465 1563 1600 1697 2136 2144 2207 2302 2342 2470 2947 3092 3278 3317 3415 3474 3546 3649 3812 3855 3957 3980 4108 4134 4213 4301 4607 4654 4806 5319 5671 5740 6050 6064 6074 6099 6109 6152 6223 6330 6563 6566 6597 6633 6665 6700 6723 7118 7341 7553 7901 8137 8167 8298 8796 8818 8906 9023 9089 9273 9341 9444 9456 9520 9573
|
||||||
2
longest-increasing-subsequence-II/output/9
Normal file
2
longest-increasing-subsequence-II/output/9
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
276
|
||||||
|
-9855 -9619 -9479 -9210 -9204 -8860 -8818 -8773 -8563 -8555 -8542 -8528 -8368 -8285 -8235 -8200 -8139 -8092 -8027 -7992 -7989 -7927 -7899 -7897 -7854 -7787 -7653 -7646 -7548 -7438 -7348 -7242 -7135 -7075 -7055 -7048 -6978 -6896 -6819 -6799 -6783 -6782 -6663 -6624 -6549 -6513 -6440 -6438 -6411 -6295 -6229 -6211 -6197 -6147 -6102 -6088 -5930 -5920 -5871 -5716 -5684 -5648 -5568 -5567 -5510 -5465 -5419 -5225 -5208 -5182 -5175 -5103 -5089 -5085 -4967 -4924 -4699 -4590 -4553 -4528 -4438 -4401 -4261 -4242 -4224 -4219 -4165 -4103 -4084 -3702 -3687 -3624 -3540 -3498 -3466 -3457 -3423 -3129 -3123 -3078 -3028 -2960 -2899 -2834 -2831 -2823 -2725 -2619 -2617 -2615 -2582 -2490 -2211 -2209 -2156 -2093 -1986 -1977 -1899 -1876 -1752 -1719 -1695 -1688 -1452 -1406 -1390 -1350 -1138 -980 -970 -948 -841 -759 -679 -553 -485 -404 -334 -250 -158 -82 -57 124 470 536 545 685 769 778 956 1025 1130 1190 1271 1299 1303 1365 1446 1555 1603 1608 1627 1729 1761 1802 1892 2179 2283 2438 2459 2461 2645 2673 2675 2768 2779 2927 3010 3088 3152 3196 3399 3477 3488 3670 3791 3849 3875 3892 3903 3910 3920 3988 4024 4083 4119 4138 4168 4180 4210 4278 4357 4393 4507 4575 4625 4634 4653 4751 4798 5014 5063 5093 5157 5190 5202 5318 5320 5589 5655 5739 5820 5894 5912 5929 5968 6111 6118 6168 6204 6424 6541 6586 6689 6741 6754 7068 7095 7283 7325 7328 7430 7459 7482 7583 7642 7792 7812 7872 7980 8029 8120 8248 8288 8362 8376 8575 8593 8658 8686 8784 8827 8842 8858 8917 9156 9192 9333 9440 9499 9530 9619 9787 9821 9919
|
||||||
64
longest-increasing-subsequence-II/problem.json
Normal file
64
longest-increasing-subsequence-II/problem.json
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
{
|
||||||
|
"version": "1.0",
|
||||||
|
"problem": {
|
||||||
|
"title": "Maior subsequência Crescente II",
|
||||||
|
"event": "",
|
||||||
|
"time_limit": 1.0,
|
||||||
|
"memory_limit_mb": 256,
|
||||||
|
"input_file": "stdin",
|
||||||
|
"output_file": "stdout",
|
||||||
|
"interactive": false,
|
||||||
|
"grader": false,
|
||||||
|
"subject": {
|
||||||
|
"en_us": [
|
||||||
|
"dynamic-programming", "DP", "LIS", "longest-increasing-subsequence"
|
||||||
|
],
|
||||||
|
"pt_br": [
|
||||||
|
"programação-dinâmica", "maior-subsequência-crescente"
|
||||||
|
],
|
||||||
|
"es": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"author": {
|
||||||
|
"name": "",
|
||||||
|
"affiliation": "",
|
||||||
|
"country": "",
|
||||||
|
"email": ""
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"run_generator": true,
|
||||||
|
"run_validator": true,
|
||||||
|
"produce_outputs": true,
|
||||||
|
"run_checker": true,
|
||||||
|
"run_all_solutions": true,
|
||||||
|
"run_specific_solution": "",
|
||||||
|
"generate_io_only": false,
|
||||||
|
"generate_pdf_only": false,
|
||||||
|
"cpu_count": 1,
|
||||||
|
"build_pdf": true,
|
||||||
|
"pdf_format": "ds",
|
||||||
|
"io_samples": 3
|
||||||
|
},
|
||||||
|
"solutions": {
|
||||||
|
"main-ac": "ac.cpp",
|
||||||
|
"alternative-ac": [],
|
||||||
|
"wrong-answer": [],
|
||||||
|
"time-limit": ["TLE.cpp"],
|
||||||
|
"time-limit-or-ac": [],
|
||||||
|
"time-limit-or-memory-limit": [],
|
||||||
|
"memory-limit": [],
|
||||||
|
"presentation-error": [],
|
||||||
|
"runtime-error": []
|
||||||
|
},
|
||||||
|
"polygon_config": {
|
||||||
|
"id": ""
|
||||||
|
},
|
||||||
|
"boca_config": {
|
||||||
|
"time_limit": 1,
|
||||||
|
"number_of_repetitions": 1,
|
||||||
|
"maximum_memory_mb": 512,
|
||||||
|
"maximum_output_size_kb": 24096
|
||||||
|
}
|
||||||
|
}
|
||||||
47
longest-increasing-subsequence-II/src/TLE.cpp
Normal file
47
longest-increasing-subsequence-II/src/TLE.cpp
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
int N; cin >> N;
|
||||||
|
vector<int> a(N);
|
||||||
|
for (int i = 0; i < N; i++) {
|
||||||
|
cin >> a[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
vector<int> d(N, 1);
|
||||||
|
vector<int> p(N, -1);
|
||||||
|
for (int i = 0; i < N; i++) {
|
||||||
|
for (int j = 0; j < i; j++) {
|
||||||
|
if (a[j] < a[i] && d[j] + 1 > d[i]) {
|
||||||
|
d[i] = d[j] + 1;
|
||||||
|
p[i] = j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int ans = d[0], pos = 0;
|
||||||
|
for (int i = 1; i < N; i++) {
|
||||||
|
if (d[i] > ans) {
|
||||||
|
ans = d[i];
|
||||||
|
pos = i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vector<int> subseq;
|
||||||
|
while (pos != -1) {
|
||||||
|
subseq.push_back(a[pos]);
|
||||||
|
pos = p[pos];
|
||||||
|
}
|
||||||
|
reverse(subseq.begin(), subseq.end());
|
||||||
|
|
||||||
|
cout << ans << endl;
|
||||||
|
for (int i = 0; i < ans; i++) {
|
||||||
|
if (i != 0) cout << " ";
|
||||||
|
cout << subseq[i];
|
||||||
|
}
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
51
longest-increasing-subsequence-II/src/ac.cpp
Normal file
51
longest-increasing-subsequence-II/src/ac.cpp
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
const int INF = 1e9;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int N;
|
||||||
|
cin >> N;
|
||||||
|
|
||||||
|
vector<int> a(N);
|
||||||
|
for (int i = 0; i < N; i++)
|
||||||
|
cin >> a[i];
|
||||||
|
|
||||||
|
vector<int> d(N + 1, INF);
|
||||||
|
vector<int> pos(N + 1, -1);
|
||||||
|
vector<int> p(N, -1);
|
||||||
|
|
||||||
|
d[0] = -INF;
|
||||||
|
int ans = 0;
|
||||||
|
for (int i = 0; i < N; i++)
|
||||||
|
{
|
||||||
|
int l = upper_bound(d.begin(), d.end(), a[i]) - d.begin();
|
||||||
|
if (d[l - 1] < a[i] && a[i] < d[l])
|
||||||
|
{
|
||||||
|
d[l] = a[i];
|
||||||
|
pos[l] = i;
|
||||||
|
p[i] = (l > 1 ? pos[l - 1] : -1);
|
||||||
|
ans = max(ans, l);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vector<int> subseq;
|
||||||
|
int cur = pos[ans];
|
||||||
|
while (cur != -1)
|
||||||
|
{
|
||||||
|
subseq.push_back(a[cur]);
|
||||||
|
cur = p[cur];
|
||||||
|
}
|
||||||
|
reverse(subseq.begin(), subseq.end());
|
||||||
|
|
||||||
|
cout << ans << endl;
|
||||||
|
for (int i = 0; i < ans; i++)
|
||||||
|
{
|
||||||
|
if (i) cout << " ";
|
||||||
|
cout << subseq[i];
|
||||||
|
}
|
||||||
|
cout << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
58
longest-increasing-subsequence-II/src/checker.cpp
Normal file
58
longest-increasing-subsequence-II/src/checker.cpp
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
#include "testlib.h"
|
||||||
|
#include <bits/stdc++.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int readAns(InStream& stream, vector<int>& nums) {
|
||||||
|
|
||||||
|
int size = stream.readInt(1, 1e5);
|
||||||
|
vector<int> ans;
|
||||||
|
while (!stream.seekEof())
|
||||||
|
ans.push_back(stream.readInt());
|
||||||
|
|
||||||
|
if (size != ans.size())
|
||||||
|
quitf(_wa, "Subsequence does not match size provided");
|
||||||
|
|
||||||
|
for (int i = 1; i < ans.size(); i++) {
|
||||||
|
if (ans[i - 1] >= ans[i]) {
|
||||||
|
quitf(_wa, "Subsequence is not strictly increasing");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// checking if numbers provided are indeed a subsequence of the original array
|
||||||
|
int j = 0;
|
||||||
|
for (int i = 0; i < nums.size() && j < ans.size(); i++) {
|
||||||
|
if (nums[i] == ans[j]) {
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (j != size) {
|
||||||
|
quitf(_wa, "The provided subsequence is not present in the original array");
|
||||||
|
}
|
||||||
|
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char* argv[]) {
|
||||||
|
setName("Set the name of your checker here");
|
||||||
|
registerTestlibCmd(argc, argv);
|
||||||
|
|
||||||
|
int n = inf.readInt();
|
||||||
|
vector<int> nums(n);
|
||||||
|
for (int i = 0; i < n; i++) nums[i] = inf.readInt();
|
||||||
|
|
||||||
|
int ja = readAns(ans, nums);
|
||||||
|
int pa = readAns(ouf, nums);
|
||||||
|
|
||||||
|
if (ja > pa)
|
||||||
|
quitf(_wa, "Expected (%i) found (%i)", ja, pa);
|
||||||
|
|
||||||
|
if (ja < pa)
|
||||||
|
quitf(_fail, "Participant gave a better answer. PA - (%i), JA - (%i)", pa, ja);
|
||||||
|
|
||||||
|
quitf(_ok, "OK");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
106
longest-increasing-subsequence-II/src/generator.cpp
Normal file
106
longest-increasing-subsequence-II/src/generator.cpp
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
#include "testlib.h"
|
||||||
|
#include <bits/stdc++.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
const int MIN_N = 1;
|
||||||
|
const int MAX_N = 1e5;
|
||||||
|
const int MIN_NI = -1e4;
|
||||||
|
const int MAX_NI = 1e4;
|
||||||
|
|
||||||
|
const int rnd_test_n = 30;
|
||||||
|
|
||||||
|
template <typename T> void append(vector<T> &dest, const vector<T> &orig) {
|
||||||
|
dest.insert(dest.end(), orig.begin(), orig.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
string output_tc(const vector<int> &nums) {
|
||||||
|
ostringstream oss;
|
||||||
|
oss << nums.size() << endl;
|
||||||
|
for (int i = 0; i < nums.size(); i++) {
|
||||||
|
if (i != 0) oss << " ";
|
||||||
|
oss << nums[i];
|
||||||
|
}
|
||||||
|
oss << endl;
|
||||||
|
return oss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
vector<string> generate_sample_tests() {
|
||||||
|
vector<string> tests;
|
||||||
|
tests.push_back(output_tc({1, 2, 3, 4, 5}));
|
||||||
|
tests.push_back(output_tc({2, 3, -1, 4}));
|
||||||
|
tests.push_back(output_tc({0}));
|
||||||
|
return tests;
|
||||||
|
}
|
||||||
|
|
||||||
|
vector<string> generate_manual_tests() {
|
||||||
|
vector<string> tests;
|
||||||
|
tests.push_back(output_tc({MIN_NI, MIN_NI, MIN_NI, MIN_NI}));
|
||||||
|
tests.push_back(output_tc({0, 0, 0, 0, -1, -1, -1, -1, -1}));
|
||||||
|
return tests;
|
||||||
|
}
|
||||||
|
|
||||||
|
string rnd_test(int i){
|
||||||
|
int min_n = MIN_N;
|
||||||
|
int max_n = MAX_N;
|
||||||
|
|
||||||
|
if(i<rnd_test_n / 3){
|
||||||
|
max_n = MAX_N/3;
|
||||||
|
}
|
||||||
|
else if(i<rnd_test_n / 2){
|
||||||
|
max_n = MAX_N/2;
|
||||||
|
}
|
||||||
|
|
||||||
|
int n = rnd.next(min_n, max_n);
|
||||||
|
vector<int> nums(n);
|
||||||
|
for (int i = 0; i < n; i++) {
|
||||||
|
nums[i] = rnd.next(MIN_NI, MAX_NI);
|
||||||
|
}
|
||||||
|
return(output_tc(nums));
|
||||||
|
}
|
||||||
|
|
||||||
|
vector<string> generate_random_tests() {
|
||||||
|
vector<string> tests;
|
||||||
|
for (int i = 0; i < rnd_test_n; i++){
|
||||||
|
tests.push_back(rnd_test(i));
|
||||||
|
}
|
||||||
|
return tests;
|
||||||
|
}
|
||||||
|
|
||||||
|
string extreme_test_1(){
|
||||||
|
vector<int> nums(MAX_N);
|
||||||
|
for (int i = 0; i < MAX_N; i++) {
|
||||||
|
nums[i] = MIN_NI;
|
||||||
|
}
|
||||||
|
return(output_tc(nums));
|
||||||
|
}
|
||||||
|
|
||||||
|
string extreme_test_2(){
|
||||||
|
vector<int> nums(MAX_N);
|
||||||
|
for (int i = 0; i < MAX_N; i++) {
|
||||||
|
nums[i] = MAX_NI;
|
||||||
|
}
|
||||||
|
return(output_tc(nums));
|
||||||
|
}
|
||||||
|
|
||||||
|
vector<string> generate_extreme_tests(){
|
||||||
|
vector<string> tests;
|
||||||
|
tests.push_back(extreme_test_1());
|
||||||
|
tests.push_back(extreme_test_2());
|
||||||
|
return tests;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
registerGen(argc, argv, 1);
|
||||||
|
vector<string> tests;
|
||||||
|
size_t test = 0;
|
||||||
|
append(tests, generate_sample_tests());
|
||||||
|
append(tests, generate_manual_tests());
|
||||||
|
append(tests, generate_random_tests());
|
||||||
|
append(tests, generate_extreme_tests());
|
||||||
|
for (const auto &t : tests) {
|
||||||
|
startTest(++test);
|
||||||
|
cout << t;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
1
longest-increasing-subsequence-II/src/script.sh
Normal file
1
longest-increasing-subsequence-II/src/script.sh
Normal file
@@ -0,0 +1 @@
|
|||||||
|
generator
|
||||||
5963
longest-increasing-subsequence-II/src/testlib.h
Normal file
5963
longest-increasing-subsequence-II/src/testlib.h
Normal file
File diff suppressed because it is too large
Load Diff
18
longest-increasing-subsequence-II/src/validator.cpp
Normal file
18
longest-increasing-subsequence-II/src/validator.cpp
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#include "testlib.h"
|
||||||
|
#include <bits/stdc++.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char* argv[]) {
|
||||||
|
registerValidation(argc, argv);
|
||||||
|
int n = inf.readInt(1, 1e5, "N");
|
||||||
|
inf.readEoln();
|
||||||
|
for (int i = 0; i < n; i++) {
|
||||||
|
if (i != 0) inf.readSpace();
|
||||||
|
inf.readInt(-1e4, 1e4, "ai");
|
||||||
|
}
|
||||||
|
inf.readEoln();
|
||||||
|
inf.readEof();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
O problema consiste em determinar a maior subsequência crescente de uma sequência de números inteiros.
|
||||||
|
Uma subsequência é formada ao remover zero ou mais elementos da sequência original, sem alterar a ordem relativa dos elementos restantes.
|
||||||
|
A subsequência procurada deve conter pelo menos um elemento, e seus valores devem estar em ordem estritamente crescente, isto é, para todos os índices válidos \( i \) e \( j \) pertencentes à subsequência, se \( i < j \) então \( a_i < a_j \).
|
||||||
|
O objetivo é identificar essa subsequência de tamanho máximo e apresentar tanto o seu comprimento quanto os próprios elementos.
|
||||||
3
longest-increasing-subsequence-II/statement/input.tex
Normal file
3
longest-increasing-subsequence-II/statement/input.tex
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
A entrada é composta por duas linhas.
|
||||||
|
A primeira linha contém um inteiro \( N \) (\( 1 \leq N \leq 10^5 \)), representando o número de elementos da sequência.
|
||||||
|
A segunda linha contém \( N \) inteiros \( a_1, a_2, \ldots, a_N \) (\( -10^4 \leq a_i \leq 10^4 \)), separados por espaços, correspondentes aos elementos da sequência.
|
||||||
3
longest-increasing-subsequence-II/statement/notes.tex
Normal file
3
longest-increasing-subsequence-II/statement/notes.tex
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Para a sequência \( (1, 2, 3, 4, 5) \), toda a sequência já é estritamente crescente, portanto o tamanho da subsequência é \( L = 5 \) e ela contém os mesmos elementos.
|
||||||
|
Para a sequência \( (2, 3, -1, 4) \), uma das maiores subsequências crescentes possíveis é \( (2, 3, 4) \), com tamanho \( L = 3 \).
|
||||||
|
Para a sequência \( (0) \), há apenas um elemento, então a maior subsequência crescente é o próprio número \( 0 \), com tamanho \( L = 1 \).
|
||||||
3
longest-increasing-subsequence-II/statement/output.tex
Normal file
3
longest-increasing-subsequence-II/statement/output.tex
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
A saída deve conter duas linhas.
|
||||||
|
A primeira linha deve conter um único inteiro representando o tamanho \( L \) da maior subsequência crescente.
|
||||||
|
A segunda linha deve conter \( L \) inteiros \( b_1, b_2, \ldots, b_L \), correspondentes aos elementos dessa subsequência, na mesma ordem em que aparecem na sequência original, separados por um espaço.
|
||||||
Reference in New Issue
Block a user