├── Algorithm算法 ├── Code │ ├── 1 │ │ ├── .vscode │ │ │ ├── 10.txt │ │ │ ├── edit.txt │ │ │ ├── launch.json │ │ │ ├── makefile │ │ │ ├── settings.json │ │ │ └── tasks.json │ │ ├── 1.4.cpp │ │ ├── 1.4.exe │ │ ├── 2.1.cpp │ │ ├── 2.1.exe │ │ ├── 2.2.cpp │ │ ├── 2.2.exe │ │ ├── 2.3.cpp │ │ └── 2.3.exe │ ├── 2 │ │ ├── .vscode │ │ │ ├── 10.txt │ │ │ ├── edit.txt │ │ │ ├── launch.json │ │ │ ├── makefile │ │ │ ├── settings.json │ │ │ └── tasks.json │ │ ├── 1.2.cpp │ │ ├── 1.2.exe │ │ ├── 1.3.cpp │ │ ├── 1.3.exe │ │ ├── 1.31.exe │ │ ├── 1.4.cpp │ │ ├── 1.4.exe │ │ ├── 1.cpp │ │ ├── 1.exe │ │ ├── 2 3.exe │ │ ├── 2.1.cpp │ │ ├── 2.1.exe │ │ ├── 2.2.cpp │ │ ├── 2.2.exe │ │ ├── 2.3.cpp │ │ ├── 2.3.exe │ │ ├── 2.4.cpp │ │ ├── 2.4.exe │ │ ├── 2.5.cpp │ │ ├── 2.5.exe │ │ ├── 2.6.cpp │ │ ├── 2.6.exe │ │ ├── 2.7.cpp │ │ ├── 2.7.exe │ │ ├── 2.8.cpp │ │ ├── 2.8.exe │ │ ├── 2.9.cpp │ │ ├── 2.9.exe │ │ ├── 2.cpp │ │ └── 2.exe │ ├── 3 │ │ ├── .history │ │ │ ├── 1_20220424161938.cpp │ │ │ ├── 1_20220424161949.cpp │ │ │ ├── 1_20220424161959.cpp │ │ │ ├── 1_20220424162057.cpp │ │ │ ├── 1_20220424162234.cpp │ │ │ ├── 1_20220424162257.cpp │ │ │ ├── 1_20220424162348.cpp │ │ │ ├── 1_20220424162350.cpp │ │ │ ├── 1_20220424162413.cpp │ │ │ ├── 1_20220424162421.cpp │ │ │ ├── 1_20220424162454.cpp │ │ │ ├── 1_20220424162517.cpp │ │ │ ├── 1_20220424162530.cpp │ │ │ ├── 1_20220424162538.cpp │ │ │ ├── 1_20220424162639.cpp │ │ │ ├── 1_20220424162641.cpp │ │ │ ├── 1_20220424162709.cpp │ │ │ ├── 1_20220424162720.cpp │ │ │ ├── 1_20220424162815.cpp │ │ │ ├── 1_20220424162816.cpp │ │ │ ├── 1_20220424162854.cpp │ │ │ ├── 1_20220424162919.cpp │ │ │ ├── 1_20220424163004.cpp │ │ │ ├── 1_20220424163433.cpp │ │ │ ├── 1_20220424163502.cpp │ │ │ ├── 1_20220424163610.cpp │ │ │ ├── 1_20220424163632.cpp │ │ │ ├── 1_20220424163633.cpp │ │ │ ├── 1_20220424163707.cpp │ │ │ ├── 1_20220424163736.cpp │ │ │ ├── 2_20220424163916.cpp │ │ │ ├── 2_20220424163926.cpp │ │ │ ├── 2_20220424163936.cpp │ │ │ ├── 2_20220424164147.cpp │ │ │ ├── 2_20220424164150.cpp │ │ │ ├── 2_20220424164217.cpp │ │ │ ├── 2_20220424164344.cpp │ │ │ ├── 2_20220428150224.cpp │ │ │ ├── 2_20220428150234.cpp │ │ │ ├── 2_20220428150543.cpp │ │ │ ├── 2_20220428150648.cpp │ │ │ ├── 2_20220428150651.cpp │ │ │ ├── 2_20220428150728.cpp │ │ │ ├── 2_20220428150818.cpp │ │ │ ├── 2_20220428151108.cpp │ │ │ ├── 2_20220428151513.cpp │ │ │ ├── 2_20220428151557.cpp │ │ │ ├── 2_20220428151601.cpp │ │ │ ├── 2_20220428151607.cpp │ │ │ ├── 2_20220428151608.cpp │ │ │ ├── 2_20220428151651.cpp │ │ │ ├── 2_20220428151710.cpp │ │ │ ├── 2_20220428151726.cpp │ │ │ ├── 2_20220428151850.cpp │ │ │ ├── 2_20220428151913.cpp │ │ │ ├── 2_20220428152227.cpp │ │ │ ├── 2_20220428152228.cpp │ │ │ ├── 2_20220428152237.cpp │ │ │ ├── 2_20220428152330.cpp │ │ │ ├── 2_20220428152435.cpp │ │ │ ├── 2_20220428152445.cpp │ │ │ ├── 2_20220428152450.cpp │ │ │ ├── 2_20220428152451.cpp │ │ │ ├── 2_20220428152530.cpp │ │ │ ├── 2_20220428152539.cpp │ │ │ ├── 2_20220428152612.cpp │ │ │ ├── 2_20220428152643.cpp │ │ │ ├── 2_20220428152646.cpp │ │ │ ├── 2_20220428152700.cpp │ │ │ ├── 2_20220428152710.cpp │ │ │ ├── 2_20220428152711.cpp │ │ │ ├── 2_20220428152733.cpp │ │ │ ├── 2_20220428152752.cpp │ │ │ ├── 2_20220428152921.cpp │ │ │ ├── 2_20220428152946.cpp │ │ │ ├── 2_20220428153039.cpp │ │ │ ├── 2_20220428153100.cpp │ │ │ ├── 2_20220428153126.cpp │ │ │ ├── 2_20220428153428.cpp │ │ │ ├── 2_20220428153438.cpp │ │ │ ├── 2_20220428153439.cpp │ │ │ ├── 2_20220428153733.cpp │ │ │ ├── 2_20220428153753.cpp │ │ │ ├── 2_20220428153805.cpp │ │ │ ├── 2_20220428153824.cpp │ │ │ ├── 2_20220428153838.cpp │ │ │ ├── 2_20220428153857.cpp │ │ │ ├── 2_20220428154438.cpp │ │ │ ├── 2_20220428154447.cpp │ │ │ └── 2_20220428154503.cpp │ │ ├── .vscode │ │ │ ├── 10.txt │ │ │ ├── edit.txt │ │ │ ├── launch.json │ │ │ ├── makefile │ │ │ ├── settings.json │ │ │ └── tasks.json │ │ ├── 1.cpp │ │ ├── 1.exe │ │ ├── 2.cpp │ │ └── 2.exe │ ├── 4 │ │ ├── .vscode │ │ │ ├── 10.txt │ │ │ ├── edit.txt │ │ │ ├── launch.json │ │ │ ├── makefile │ │ │ ├── settings.json │ │ │ └── tasks.json │ │ ├── 1.1.cpp │ │ ├── 1.cpp │ │ ├── 1.exe │ │ ├── 2.cpp │ │ ├── 2.exe │ │ ├── 拧魔方.cpp │ │ └── 解魔方-帮助文档 (c++版).pdf │ ├── 5 │ │ ├── .history │ │ │ ├── 1.1_20220527095220.cpp │ │ │ ├── 1.1_20220527095222.cpp │ │ │ ├── 1.1_20220527131540.cpp │ │ │ ├── 1.1_20220527131553.cpp │ │ │ ├── 1.1_20220527131603.cpp │ │ │ ├── 1.1_20220527131612.cpp │ │ │ ├── 1.1_20220527131613.cpp │ │ │ ├── 1.1_20220527131616.cpp │ │ │ ├── 1.1_20220527131640.cpp │ │ │ ├── 1.1_20220527132105.cpp │ │ │ ├── 1.1_20220527132111.cpp │ │ │ ├── 1.1_20220527132147.cpp │ │ │ ├── 1.1_20220527132238.cpp │ │ │ ├── 1.1_20220527132244.cpp │ │ │ ├── 1.1_20220527132332.cpp │ │ │ ├── 1.1_20220527132400.cpp │ │ │ ├── 1.1_20220527132627.cpp │ │ │ ├── 1.2_20220527132656.cpp │ │ │ ├── 1.2_20220527132658.cpp │ │ │ ├── 1.2_20220527132715.cpp │ │ │ ├── 1.2_20220527132719.cpp │ │ │ ├── 1.2_20220527132750.cpp │ │ │ ├── 1.2_20220527132824.cpp │ │ │ ├── 1.2_20220527132838.cpp │ │ │ ├── 1.2_20220527132846.cpp │ │ │ ├── 1.2_20220527132849.cpp │ │ │ ├── 1.2_20220527132932.cpp │ │ │ ├── 1.2_20220527132938.cpp │ │ │ ├── 1.2_20220527132958.cpp │ │ │ ├── 1.2_20220527133050.cpp │ │ │ ├── 1.2_20220527133108.cpp │ │ │ ├── 1.2_20220527133921.cpp │ │ │ ├── 1.2_20220527133951.cpp │ │ │ ├── 1.2_20220527133958.cpp │ │ │ ├── 1.2_20220527134125.cpp │ │ │ ├── 1.2_20220527134145.cpp │ │ │ ├── 1.2_20220527134208.cpp │ │ │ ├── 1.2_20220527134259.cpp │ │ │ ├── 1.2_20220527134401.cpp │ │ │ ├── 1.2_20220527134526.cpp │ │ │ ├── 1.2_20220527134617.cpp │ │ │ ├── 1.2_20220527134656.cpp │ │ │ ├── 1.2_20220527134726.cpp │ │ │ ├── 1.2_20220527134838.cpp │ │ │ ├── 1.2_20220527134905.cpp │ │ │ ├── 1.2_20220527134914.cpp │ │ │ ├── 1.2_20220527134937.cpp │ │ │ ├── 1.2_20220527134949.cpp │ │ │ ├── 1.2_20220527135041.cpp │ │ │ ├── 1.2_20220527135142.cpp │ │ │ ├── 1.2_20220527135500.cpp │ │ │ ├── 1.2_20220527135546.cpp │ │ │ ├── 1.2_20220527135557.cpp │ │ │ ├── 1.2_20220527135636.cpp │ │ │ ├── 1.2_20220527135647.cpp │ │ │ ├── 1.2_20220527135717.cpp │ │ │ ├── 1.2_20220527135756.cpp │ │ │ ├── 1.2_20220527135902.cpp │ │ │ ├── 1.2_20220527135922.cpp │ │ │ ├── 1.2_20220527135943.cpp │ │ │ ├── 1.2_20220527135952.cpp │ │ │ ├── 1.2_20220527140002.cpp │ │ │ ├── 1.2_20220527140003.cpp │ │ │ ├── 1.2_20220527150614.cpp │ │ │ ├── 1.3_20220527150618.cpp │ │ │ ├── 1.3_20220527150648.cpp │ │ │ ├── 1.3_20220527150702.cpp │ │ │ ├── 1.3_20220527150735.cpp │ │ │ ├── 1.3_20220527150747.cpp │ │ │ ├── 1.3_20220527150815.cpp │ │ │ ├── 1.3_20220527150828.cpp │ │ │ ├── 1.3_20220527150902.cpp │ │ │ ├── 1.3_20220527150906.cpp │ │ │ ├── 1.3_20220527150925.cpp │ │ │ ├── 1.3_20220527150936.cpp │ │ │ ├── 1.3_20220527151009.cpp │ │ │ ├── 1.3_20220527151015.cpp │ │ │ ├── 1.3_20220527151025.cpp │ │ │ ├── 1.3_20220527151055.cpp │ │ │ ├── 1.3_20220527151131.cpp │ │ │ ├── 1.3_20220527151214.cpp │ │ │ ├── 1.3_20220527151230.cpp │ │ │ ├── 1.3_20220527151231.cpp │ │ │ ├── 1.3_20220527151250.cpp │ │ │ ├── 1.3_20220527151633.cpp │ │ │ ├── 1.3_20220527151642.cpp │ │ │ ├── 1.3_20220527151802.cpp │ │ │ ├── 1.3_20220527151845.cpp │ │ │ ├── 1.3_20220527151911.cpp │ │ │ ├── 1.3_20220527151956.cpp │ │ │ ├── 1.3_20220527152352.cpp │ │ │ ├── 1.3_20220527152414.cpp │ │ │ ├── 1.3_20220527152428.cpp │ │ │ ├── 1.3_20220527152749.cpp │ │ │ ├── 1.3_20220527152758.cpp │ │ │ ├── 1.3_20220527152804.cpp │ │ │ ├── 1.3_20220527152907.cpp │ │ │ ├── 1.3_20220527153007.cpp │ │ │ ├── 1.3_20220527153135.cpp │ │ │ ├── 1.3_20220527153205.cpp │ │ │ ├── 1.3_20220527153220.cpp │ │ │ ├── 1.3_20220527153334.cpp │ │ │ ├── 1.3_20220527153406.cpp │ │ │ ├── 1.3_20220527153414.cpp │ │ │ ├── 1.3_20220527153543.cpp │ │ │ ├── 1.3_20220527153550.cpp │ │ │ ├── 1.3_20220527153604.cpp │ │ │ ├── 1.3_20220527153837.cpp │ │ │ ├── 1.3_20220527153845.cpp │ │ │ ├── 1.3_20220527153906.cpp │ │ │ ├── 1.3_20220527153923.cpp │ │ │ ├── 1.3_20220527153948.cpp │ │ │ ├── 1.3_20220527154000.cpp │ │ │ ├── 1.3_20220527154018.cpp │ │ │ ├── 1.3_20220527154034.cpp │ │ │ ├── 1.3_20220527154108.cpp │ │ │ ├── 1.3_20220527154136.cpp │ │ │ ├── 1.3_20220527154141.cpp │ │ │ ├── 1.3_20220527154147.cpp │ │ │ ├── 1.3_20220527154201.cpp │ │ │ ├── 1.3_20220527154219.cpp │ │ │ ├── 1.3_20220527154233.cpp │ │ │ ├── 1.3_20220527154244.cpp │ │ │ ├── 1.3_20220527154327.cpp │ │ │ ├── 1.3_20220527154342.cpp │ │ │ ├── 1.3_20220527154343.cpp │ │ │ ├── 1.3_20220527154348.cpp │ │ │ ├── 1.3_20220527154528.cpp │ │ │ ├── 1.3_20220527154606.cpp │ │ │ ├── 1.3_20220527154923.cpp │ │ │ ├── 1.3_20220527154948.cpp │ │ │ ├── 1.3_20220527154959.cpp │ │ │ ├── 1.3_20220527155008.cpp │ │ │ ├── 1.3_20220527155100.cpp │ │ │ ├── 1.3_20220527155105.cpp │ │ │ ├── 1.3_20220527155133.cpp │ │ │ ├── 1.3_20220527155141.cpp │ │ │ ├── 1.3_20220527155142.cpp │ │ │ ├── 1.3_20220527155316.cpp │ │ │ ├── 1.3_20220527155430.cpp │ │ │ ├── 1.3_20220527155605.cpp │ │ │ ├── 1.3_20220527155817.cpp │ │ │ ├── 1.3_20220527155835.cpp │ │ │ ├── 1.3_20220527155922.cpp │ │ │ ├── 1.3_20220527155937.cpp │ │ │ ├── 1.3_20220527155953.cpp │ │ │ ├── 1.3_20220527160001.cpp │ │ │ ├── 1.3_20220527160014.cpp │ │ │ ├── 1.3_20220527160033.cpp │ │ │ ├── 1.3_20220527160056.cpp │ │ │ ├── 1.3_20220527160332.cpp │ │ │ ├── 1.3_20220527160625.cpp │ │ │ ├── 1.3_20220527160714.cpp │ │ │ ├── 1.3_20220527160721.cpp │ │ │ ├── 1.3_20220527160740.cpp │ │ │ ├── 1.3_20220527160756.cpp │ │ │ ├── 1.3_20220527160812.cpp │ │ │ ├── 1.3_20220527160921.cpp │ │ │ ├── 1.3_20220527160928.cpp │ │ │ ├── 1.3_20220527200500.cpp │ │ │ ├── 1.3_20220527200600.cpp │ │ │ ├── 1.3_20220527200613.cpp │ │ │ ├── 1.3_20220527200704.cpp │ │ │ ├── 1.3_20220527200705.cpp │ │ │ ├── 1.3_20220527200718.cpp │ │ │ ├── 1.3_20220527200918.cpp │ │ │ ├── 1.3_20220527200929.cpp │ │ │ ├── 1.3_20220527200949.cpp │ │ │ ├── 1.3_20220527200958.cpp │ │ │ ├── 1.3_20220527201017.cpp │ │ │ ├── 1.3_20220527201031.cpp │ │ │ ├── 1.3_20220527201046.cpp │ │ │ ├── 1.3_20220527201146.cpp │ │ │ ├── 1.3_20220527201328.cpp │ │ │ ├── 1.3_20220527201355.cpp │ │ │ ├── 1.3_20220527201402.cpp │ │ │ ├── 1.4_20220527201830.cpp │ │ │ ├── 1.4_20220527201835.cpp │ │ │ ├── 1.4_20220527201852.cpp │ │ │ ├── 1.4_20220527201920.cpp │ │ │ ├── 1.4_20220527201926.cpp │ │ │ ├── 1.4_20220527202019.cpp │ │ │ ├── 1.4_20220527202031.cpp │ │ │ ├── 1.4_20220527202044.cpp │ │ │ ├── 1.4_20220527202258.cpp │ │ │ ├── 1.4_20220527202656.cpp │ │ │ ├── 1.4_20220527202747.cpp │ │ │ ├── 1.4_20220527202804.cpp │ │ │ ├── 1.4_20220527202836.cpp │ │ │ ├── 1.4_20220527202840.cpp │ │ │ ├── 1.4_20220527202856.cpp │ │ │ ├── 1.4_20220527202955.cpp │ │ │ ├── 1.4_20220527203107.cpp │ │ │ ├── 1.4_20220527203115.cpp │ │ │ ├── 1.4_20220527203245.cpp │ │ │ ├── 1.4_20220527203247.cpp │ │ │ ├── 1.4_20220527203320.cpp │ │ │ ├── 1.4_20220527203337.cpp │ │ │ ├── 1.4_20220527203355.cpp │ │ │ ├── 1.4_20220527203549.cpp │ │ │ ├── 1.4_20220527203611.cpp │ │ │ ├── 1.4_20220527203624.cpp │ │ │ ├── 1.4_20220527203702.cpp │ │ │ ├── 1.4_20220527203715.cpp │ │ │ ├── 1.4_20220527203755.cpp │ │ │ ├── 1.4_20220527203857.cpp │ │ │ ├── 1.4_20220527203951.cpp │ │ │ ├── 1.4_20220527204212.cpp │ │ │ ├── 1.4_20220527204221.cpp │ │ │ ├── 1.4_20220527204254.cpp │ │ │ ├── 1.4_20220527204307.cpp │ │ │ ├── 1.4_20220527204331.cpp │ │ │ ├── 1.4_20220527204353.cpp │ │ │ ├── 1.4_20220527204404.cpp │ │ │ ├── 1.4_20220527204429.cpp │ │ │ ├── 1.4_20220527204506.cpp │ │ │ ├── 1.4_20220527204529.cpp │ │ │ ├── 1.4_20220527204540.cpp │ │ │ ├── 1.4_20220527204812.cpp │ │ │ ├── 1.4_20220527204901.cpp │ │ │ ├── 1.4_20220527204914.cpp │ │ │ ├── 1.4_20220527204938.cpp │ │ │ ├── 1.4_20220527205148.cpp │ │ │ ├── 1.4_20220527205210.cpp │ │ │ ├── 1.4_20220527205222.cpp │ │ │ ├── 1.4_20220527205249.cpp │ │ │ ├── 1.4_20220527205301.cpp │ │ │ ├── 1.4_20220527205316.cpp │ │ │ ├── 1.4_20220527205332.cpp │ │ │ ├── 1.4_20220527205336.cpp │ │ │ ├── 1.4_20220527205346.cpp │ │ │ ├── 1.4_20220527205428.cpp │ │ │ ├── 1.4_20220527205447.cpp │ │ │ ├── 1.4_20220527205449.cpp │ │ │ ├── 1.4_20220527205525.cpp │ │ │ ├── 1.4_20220527205659.cpp │ │ │ ├── 1.4_20220527205735.cpp │ │ │ ├── 1.4_20220527205743.cpp │ │ │ ├── 1.4_20220527205803.cpp │ │ │ ├── 1.4_20220527205903.cpp │ │ │ ├── 1.4_20220527205951.cpp │ │ │ ├── 1.4_20220527210406.cpp │ │ │ ├── 1.4_20220527210550.cpp │ │ │ ├── 1.4_20220527210904.cpp │ │ │ ├── 1.4_20220527211027.cpp │ │ │ ├── 1.4_20220527211817.cpp │ │ │ ├── 1.4_20220527211836.cpp │ │ │ ├── 1.4_20220527212051.cpp │ │ │ ├── 1.4_20220527212231.cpp │ │ │ ├── 1.4_20220527212236.cpp │ │ │ ├── 1.4_20220527212242.cpp │ │ │ ├── 1.4_20220527212432.cpp │ │ │ ├── 1.4_20220527212451.cpp │ │ │ ├── 1.4_20220527212832.cpp │ │ │ ├── 1.4_20220527212902.cpp │ │ │ ├── 1.4_20220527212906.cpp │ │ │ ├── 1.4_20220527212919.cpp │ │ │ ├── 1.4_20220527212921.cpp │ │ │ ├── 1.4_20220527213049.cpp │ │ │ ├── 1.4_20220527213233.cpp │ │ │ ├── 1.4_20220527213414.cpp │ │ │ ├── 1.4_20220527213421.cpp │ │ │ ├── 1.4_20220527213441.cpp │ │ │ ├── 1.4_20220527213745.cpp │ │ │ ├── 1.4_20220527213752.cpp │ │ │ ├── 1.4_20220527213833.cpp │ │ │ ├── 1.4_20220527214036.cpp │ │ │ ├── 1.4_20220527214107.cpp │ │ │ ├── 1.4_20220527214125.cpp │ │ │ ├── 1.4_20220527214131.cpp │ │ │ ├── 1.4_20220527214748.cpp │ │ │ ├── 1.4_20220527214804.cpp │ │ │ ├── 1.4_20220527215234.cpp │ │ │ ├── 1.4_20220527220213.cpp │ │ │ ├── 1.4_20220527220244.cpp │ │ │ ├── 1.4_20220527220257.cpp │ │ │ ├── 1.4_20220527220339.cpp │ │ │ ├── 1.4_20220527220358.cpp │ │ │ ├── 1.4_20220527220413.cpp │ │ │ ├── 1.4_20220527220427.cpp │ │ │ ├── 1.4_20220527220529.cpp │ │ │ ├── 1.4_20220527220648.cpp │ │ │ ├── 1.4_20220527220704.cpp │ │ │ ├── 1.4_20220527220706.cpp │ │ │ ├── 1.4_20220527220800.cpp │ │ │ ├── 1.4_20220527222345.cpp │ │ │ ├── 1.4_20220527222510.cpp │ │ │ ├── 1.4_20220527222525.cpp │ │ │ ├── 1.4_20220527222526.cpp │ │ │ ├── 1.4_20220527222529.cpp │ │ │ ├── 1.4_20220527222604.cpp │ │ │ ├── 1.4_20220527222616.cpp │ │ │ ├── 1.4_20220527222629.cpp │ │ │ ├── 1.4_20220527222702.cpp │ │ │ ├── 1.4_20220527222716.cpp │ │ │ ├── 1.4_20220527222928.cpp │ │ │ ├── 1.4_20220527223125.cpp │ │ │ ├── 1.4_20220527223257.cpp │ │ │ ├── 1.4_20220527223306.cpp │ │ │ ├── 1.4_20220527223314.cpp │ │ │ ├── 1.4_20220527223459.cpp │ │ │ ├── 1.4_20220527225024.cpp │ │ │ ├── 1.4_20220527230220.cpp │ │ │ ├── 1.4_20220527230439.cpp │ │ │ ├── 1.4_20220527231341.cpp │ │ │ ├── 1.4_20220527231459.cpp │ │ │ ├── 1.4_20220527231612.cpp │ │ │ ├── 1.4_20220527231629.cpp │ │ │ ├── 1.4_20220527231656.cpp │ │ │ ├── 1.4_20220527231727.cpp │ │ │ ├── 1.4_20220527231932.cpp │ │ │ ├── 1.4_20220527231959.cpp │ │ │ ├── 1.4_20220527232013.cpp │ │ │ ├── 1.4_20220527232103.cpp │ │ │ ├── 1.4_20220527232152.cpp │ │ │ ├── 1.4_20220527232355.cpp │ │ │ ├── 1.4_20220527232451.cpp │ │ │ ├── 1.4_20220527232514.cpp │ │ │ ├── 1.4_20220527232751.cpp │ │ │ ├── 1.4_20220527233009.cpp │ │ │ ├── 1.4_20220527233219.cpp │ │ │ ├── 1.4_20220527233609.cpp │ │ │ ├── 1.4_20220527234155.cpp │ │ │ ├── 1.4_20220527234244.cpp │ │ │ ├── 1.4_20220527234250.cpp │ │ │ ├── 1.4_20220527234302.cpp │ │ │ ├── 1.5_20220527214855.cpp │ │ │ ├── 1.5_20220527215115.cpp │ │ │ ├── 1.5_20220527215130.cpp │ │ │ ├── 1.5_20220527215213.cpp │ │ │ ├── 1.5_20220527215223.cpp │ │ │ ├── 1.5_20220527215315.cpp │ │ │ ├── 1.5_20220527215346.cpp │ │ │ ├── 1.5_20220527215350.cpp │ │ │ ├── 1.5_20220527215355.cpp │ │ │ ├── 1.5_20220527215433.cpp │ │ │ ├── 1.5_20220527215836.cpp │ │ │ ├── 1.5_20220527215842.cpp │ │ │ ├── 1.5_20220527215843.cpp │ │ │ ├── 1.5_20220527215918.cpp │ │ │ ├── 1.5_20220527220019.cpp │ │ │ ├── 1_20220524183810.cpp │ │ │ ├── 1_20220524183828.cpp │ │ │ ├── 1_20220524184033.cpp │ │ │ ├── 1_20220524184037.cpp │ │ │ ├── 1_20220524184101.cpp │ │ │ ├── 1_20220524184107.cpp │ │ │ ├── 1_20220524184111.cpp │ │ │ ├── 1_20220524184255.cpp │ │ │ ├── 1_20220524200006.cpp │ │ │ ├── 1_20220524200030.cpp │ │ │ ├── 1_20220524200113.cpp │ │ │ ├── 1_20220524200136.cpp │ │ │ ├── 1_20220524200151.cpp │ │ │ ├── 1_20220524200213.cpp │ │ │ ├── 1_20220524200216.cpp │ │ │ ├── 1_20220524200227.cpp │ │ │ ├── 1_20220524200230.cpp │ │ │ ├── 1_20220524200253.cpp │ │ │ ├── 1_20220524200254.cpp │ │ │ ├── 1_20220524200310.cpp │ │ │ ├── 1_20220524200350.cpp │ │ │ ├── 1_20220524200412.cpp │ │ │ ├── 1_20220524200516.cpp │ │ │ ├── 1_20220524200706.cpp │ │ │ ├── 1_20220524200708.cpp │ │ │ ├── 1_20220524200721.cpp │ │ │ ├── 1_20220524200756.cpp │ │ │ ├── 1_20220526193953.cpp │ │ │ ├── 1_20220526194020.cpp │ │ │ ├── 1_20220526194029.cpp │ │ │ ├── 1_20220526194030.cpp │ │ │ ├── 1_20220526194038.cpp │ │ │ ├── 1_20220526194042.cpp │ │ │ ├── 1_20220526194103.cpp │ │ │ ├── 1_20220526200347.cpp │ │ │ ├── 1_20220526200431.cpp │ │ │ ├── 1_20220526200656.cpp │ │ │ ├── 1_20220526200746.cpp │ │ │ ├── 1_20220526200751.cpp │ │ │ ├── 1_20220526201027.cpp │ │ │ ├── 1_20220526201216.cpp │ │ │ ├── 1_20220526201219.cpp │ │ │ ├── 1_20220526201220.cpp │ │ │ ├── 1_20220526201426.cpp │ │ │ ├── 1_20220526201436.cpp │ │ │ ├── 1_20220526201512.cpp │ │ │ ├── 1_20220526201527.cpp │ │ │ ├── 1_20220526201535.cpp │ │ │ ├── 1_20220526201540.cpp │ │ │ ├── 1_20220526201604.cpp │ │ │ ├── 1_20220526201723.cpp │ │ │ ├── 1_20220526201729.cpp │ │ │ ├── 1_20220526201753.cpp │ │ │ ├── 1_20220526201817.cpp │ │ │ ├── 1_20220526201917.cpp │ │ │ ├── 1_20220526201932.cpp │ │ │ ├── 1_20220526201938.cpp │ │ │ ├── 1_20220526202324.cpp │ │ │ ├── 1_20220526202328.cpp │ │ │ ├── 1_20220526202331.cpp │ │ │ ├── 1_20220526202441.cpp │ │ │ ├── 1_20220526202451.cpp │ │ │ ├── 1_20220526202459.cpp │ │ │ ├── 1_20220526202504.cpp │ │ │ ├── 1_20220526202552.cpp │ │ │ ├── 1_20220526202638.cpp │ │ │ ├── 1_20220526202758.cpp │ │ │ ├── 1_20220526202835.cpp │ │ │ ├── 1_20220526202850.cpp │ │ │ ├── 1_20220526202857.cpp │ │ │ ├── 1_20220526202907.cpp │ │ │ ├── 1_20220526202914.cpp │ │ │ ├── 1_20220526203336.cpp │ │ │ ├── 1_20220526203342.cpp │ │ │ ├── 1_20220526203355.cpp │ │ │ ├── 1_20220526203402.cpp │ │ │ ├── 1_20220526203415.cpp │ │ │ ├── 1_20220526203518.cpp │ │ │ ├── 1_20220526203520.cpp │ │ │ ├── 1_20220526203528.cpp │ │ │ ├── 1_20220526203534.cpp │ │ │ ├── 1_20220526203623.cpp │ │ │ ├── 1_20220526203646.cpp │ │ │ ├── 1_20220526203657.cpp │ │ │ ├── 1_20220526203727.cpp │ │ │ ├── 1_20220526203756.cpp │ │ │ ├── 1_20220526203847.cpp │ │ │ ├── 1_20220526203849.cpp │ │ │ ├── 1_20220526203858.cpp │ │ │ ├── 1_20220526204020.cpp │ │ │ ├── 1_20220526204026.cpp │ │ │ ├── 1_20220526204209.cpp │ │ │ ├── 1_20220526204245.cpp │ │ │ ├── 1_20220526204343.cpp │ │ │ ├── 1_20220526204344.cpp │ │ │ ├── 1_20220526204400.cpp │ │ │ ├── 1_20220526204407.cpp │ │ │ ├── 1_20220526204412.cpp │ │ │ ├── 1_20220526204423.cpp │ │ │ ├── 1_20220526204431.cpp │ │ │ ├── 1_20220526204434.cpp │ │ │ ├── 1_20220526204436.cpp │ │ │ ├── 1_20220526204451.cpp │ │ │ ├── 1_20220526204509.cpp │ │ │ ├── 1_20220526204532.cpp │ │ │ ├── 1_20220526204545.cpp │ │ │ ├── 1_20220526204548.cpp │ │ │ ├── 1_20220526204711.cpp │ │ │ ├── 1_20220526204816.cpp │ │ │ ├── 1_20220526204856.cpp │ │ │ ├── 1_20220526204942.cpp │ │ │ ├── 1_20220526204945.cpp │ │ │ ├── 1_20220526205105.cpp │ │ │ ├── 1_20220526205157.cpp │ │ │ ├── 1_20220526205203.cpp │ │ │ ├── 1_20220526205420.cpp │ │ │ ├── 1_20220526205430.cpp │ │ │ ├── 1_20220526205442.cpp │ │ │ ├── 1_20220526205625.cpp │ │ │ ├── 1_20220526205703.cpp │ │ │ ├── 1_20220526205723.cpp │ │ │ ├── 1_20220526205736.cpp │ │ │ ├── 1_20220526205742.cpp │ │ │ ├── 1_20220526205809.cpp │ │ │ ├── 1_20220526205825.cpp │ │ │ ├── 1_20220526205928.cpp │ │ │ ├── 1_20220526205939.cpp │ │ │ ├── 1_20220526205958.cpp │ │ │ ├── 1_20220526210007.cpp │ │ │ ├── 1_20220526210022.cpp │ │ │ ├── 1_20220526210049.cpp │ │ │ ├── 1_20220526210100.cpp │ │ │ ├── 1_20220526210115.cpp │ │ │ ├── 1_20220526210144.cpp │ │ │ ├── 1_20220526210158.cpp │ │ │ ├── 1_20220526210213.cpp │ │ │ ├── 1_20220526210228.cpp │ │ │ ├── 1_20220526210241.cpp │ │ │ ├── 1_20220526210251.cpp │ │ │ ├── 1_20220526210340.cpp │ │ │ ├── 1_20220526210353.cpp │ │ │ ├── 1_20220526210623.cpp │ │ │ ├── 1_20220526210748.cpp │ │ │ ├── 1_20220526210804.cpp │ │ │ ├── 1_20220526210848.cpp │ │ │ ├── 1_20220526211306.cpp │ │ │ ├── 1_20220526211413.cpp │ │ │ ├── 1_20220526211519.cpp │ │ │ ├── 1_20220526211700.cpp │ │ │ ├── 1_20220526211739.cpp │ │ │ ├── 1_20220526212121.cpp │ │ │ ├── 1_20220526212124.cpp │ │ │ ├── 1_20220526212401.cpp │ │ │ ├── 1_20220526212412.cpp │ │ │ ├── 1_20220526212415.cpp │ │ │ ├── 1_20220526212416.cpp │ │ │ ├── 1_20220526212516.cpp │ │ │ ├── 1_20220526212711.cpp │ │ │ ├── 1_20220526212756.cpp │ │ │ ├── 1_20220526212758.cpp │ │ │ ├── 1_20220526212809.cpp │ │ │ ├── 1_20220526212823.cpp │ │ │ ├── 1_20220526212839.cpp │ │ │ ├── 1_20220526212849.cpp │ │ │ ├── 1_20220526212858.cpp │ │ │ ├── 1_20220526212943.cpp │ │ │ ├── 1_20220526213003.cpp │ │ │ ├── 1_20220526213010.cpp │ │ │ ├── 1_20220526213300.cpp │ │ │ ├── 1_20220526213338.cpp │ │ │ ├── 1_20220526213346.cpp │ │ │ ├── 1_20220526213449.cpp │ │ │ ├── 1_20220526213603.cpp │ │ │ ├── 1_20220526214342.cpp │ │ │ ├── 1_20220526214356.cpp │ │ │ ├── 1_20220526214420.cpp │ │ │ ├── 1_20220526214649.cpp │ │ │ ├── 1_20220526215451.cpp │ │ │ ├── 1_20220526215737.cpp │ │ │ ├── 1_20220526215741.cpp │ │ │ ├── 1_20220526215839.cpp │ │ │ ├── 1_20220526220001.cpp │ │ │ ├── 1_20220526220012.cpp │ │ │ ├── 1_20220526220025.cpp │ │ │ ├── 1_20220526220032.cpp │ │ │ ├── 1_20220526220536.cpp │ │ │ ├── 1_20220526220721.cpp │ │ │ ├── 1_20220526220735.cpp │ │ │ ├── 1_20220526220747.cpp │ │ │ ├── 1_20220526220758.cpp │ │ │ ├── 1_20220526220809.cpp │ │ │ ├── 1_20220526220902.cpp │ │ │ ├── 1_20220526221025.cpp │ │ │ ├── 1_20220526221047.cpp │ │ │ ├── 1_20220526221100.cpp │ │ │ ├── 1_20220526221808.cpp │ │ │ ├── 1_20220526221809.cpp │ │ │ ├── 1_20220526222342.cpp │ │ │ ├── 1_20220526222356.cpp │ │ │ ├── 1_20220526222530.cpp │ │ │ ├── 1_20220526222535.cpp │ │ │ ├── 1_20220526222556.cpp │ │ │ ├── 1_20220526222608.cpp │ │ │ ├── 1_20220526222615.cpp │ │ │ ├── 1_20220526222634.cpp │ │ │ ├── 1_20220526222638.cpp │ │ │ ├── 1_20220526222642.cpp │ │ │ ├── 1_20220526222708.cpp │ │ │ ├── 1_20220526222709.cpp │ │ │ ├── 1_20220526222719.cpp │ │ │ ├── 1_20220526222732.cpp │ │ │ ├── 1_20220526222812.cpp │ │ │ ├── 1_20220526222822.cpp │ │ │ ├── 1_20220526231015.cpp │ │ │ ├── 1_20220526231112.cpp │ │ │ ├── 1_20220526231134.cpp │ │ │ ├── 1_20220526231527.cpp │ │ │ ├── 1_20220526231616.cpp │ │ │ ├── 1_20220526231958.cpp │ │ │ ├── 1_20220526233629.cpp │ │ │ ├── 1_20220526233656.cpp │ │ │ ├── 1_20220526233710.cpp │ │ │ ├── 1_20220526233715.cpp │ │ │ ├── 1_20220526233825.cpp │ │ │ ├── 1_20220526233831.cpp │ │ │ ├── 1_20220526233835.cpp │ │ │ ├── 1_20220526233838.cpp │ │ │ ├── 1_20220526233855.cpp │ │ │ ├── 1_20220526234248.cpp │ │ │ ├── 1_20220526234312.cpp │ │ │ ├── 1_20220526234324.cpp │ │ │ ├── 1_20220526234424.cpp │ │ │ ├── 1_20220526234514.cpp │ │ │ ├── 1_20220526234923.cpp │ │ │ ├── 1_20220526234959.cpp │ │ │ ├── 1_20220526235006.cpp │ │ │ ├── 1_20220526235007.cpp │ │ │ ├── 1_20220526235022.cpp │ │ │ ├── 1_20220526235203.cpp │ │ │ ├── 1_20220526235204.cpp │ │ │ ├── 1_20220526235210.cpp │ │ │ ├── 1_20220526235248.cpp │ │ │ ├── 1_20220526235258.cpp │ │ │ ├── 1_20220526235319.cpp │ │ │ ├── 1_20220526235321.cpp │ │ │ ├── 1_20220526235330.cpp │ │ │ ├── 1_20220526235346.cpp │ │ │ ├── 1_20220526235405.cpp │ │ │ ├── 1_20220526235406.cpp │ │ │ ├── 1_20220526235452.cpp │ │ │ ├── 1_20220526235639.cpp │ │ │ ├── 1_20220526235705.cpp │ │ │ ├── 1_20220526235940.cpp │ │ │ ├── 1_20220526235951.cpp │ │ │ ├── 1_20220527000121.cpp │ │ │ ├── 1_20220527000142.cpp │ │ │ ├── 1_20220527000220.cpp │ │ │ ├── 1_20220527000252.cpp │ │ │ ├── 1_20220527000707.cpp │ │ │ ├── 1_20220527000714.cpp │ │ │ ├── 1_20220527000745.cpp │ │ │ ├── 1_20220527000748.cpp │ │ │ ├── 1_20220527000803.cpp │ │ │ ├── 1_20220527000848.cpp │ │ │ ├── 1_20220527000905.cpp │ │ │ ├── 1_20220527000936.cpp │ │ │ ├── 1_20220527000954.cpp │ │ │ ├── 1_20220527001039.cpp │ │ │ ├── 1_20220527001258.cpp │ │ │ ├── 1_20220527001321.cpp │ │ │ ├── 1_20220527001350.cpp │ │ │ ├── 1_20220527001425.cpp │ │ │ ├── 1_20220527001508.cpp │ │ │ ├── 1_20220527001516.cpp │ │ │ ├── 1_20220527001605.cpp │ │ │ ├── 1_20220527001633.cpp │ │ │ ├── 1_20220527002003.cpp │ │ │ ├── 1_20220527002026.cpp │ │ │ ├── 1_20220527002051.cpp │ │ │ ├── 1_20220527002127.cpp │ │ │ ├── 1_20220527002157.cpp │ │ │ ├── 1_20220527002635.cpp │ │ │ ├── 1_20220527002637.cpp │ │ │ ├── 1_20220527002925.cpp │ │ │ ├── 1_20220527003358.cpp │ │ │ ├── 1_20220527003400.cpp │ │ │ ├── 1_20220527003633.cpp │ │ │ ├── 1_20220527093117.cpp │ │ │ ├── 1_20220527093136.cpp │ │ │ ├── 1_20220527093628.cpp │ │ │ ├── 1_20220527093914.cpp │ │ │ ├── 1_20220527093926.cpp │ │ │ ├── 1_20220527094034.cpp │ │ │ ├── 1_20220527094059.cpp │ │ │ ├── 1_20220527094614.cpp │ │ │ ├── 1_20220527094639.cpp │ │ │ ├── 1_20220527094648.cpp │ │ │ ├── 1_20220527094712.cpp │ │ │ ├── 1_20220527094756.cpp │ │ │ ├── 1_20220527094811.cpp │ │ │ ├── 1_20220527094830.cpp │ │ │ ├── 1_20220527094837.cpp │ │ │ ├── 1_20220527094923.cpp │ │ │ ├── 1_20220527094932.cpp │ │ │ ├── 1_20220527094940.cpp │ │ │ ├── 1_20220527094947.cpp │ │ │ ├── 1_20220527094959.cpp │ │ │ ├── 1_20220527095102.cpp │ │ │ ├── 1_20220527095214.cpp │ │ │ ├── 2_20220527162750.cpp │ │ │ ├── 2_20220527162757.cpp │ │ │ ├── 2_20220527163256.cpp │ │ │ ├── 2_20220527163346.cpp │ │ │ ├── 2_20220527163531.cpp │ │ │ ├── 2_20220527163623.cpp │ │ │ ├── 2_20220527163716.cpp │ │ │ ├── 2_20220527163745.cpp │ │ │ ├── 2_20220527163852.cpp │ │ │ ├── 2_20220527163925.cpp │ │ │ ├── 2_20220527163932.cpp │ │ │ ├── 2_20220527164009.cpp │ │ │ ├── 2_20220527164028.cpp │ │ │ ├── 2_20220527164029.cpp │ │ │ ├── 2_20220527164035.cpp │ │ │ ├── 2_20220527164057.cpp │ │ │ ├── 2_20220527164116.cpp │ │ │ ├── 2_20220527164118.cpp │ │ │ ├── 2_20220527164126.cpp │ │ │ ├── 2_20220527164202.cpp │ │ │ ├── 2_20220527164205.cpp │ │ │ ├── 2_20220527164223.cpp │ │ │ ├── 2_20220527164256.cpp │ │ │ ├── 2_20220527164314.cpp │ │ │ ├── 2_20220527164315.cpp │ │ │ ├── 2_20220527164328.cpp │ │ │ ├── 2_20220527164333.cpp │ │ │ ├── 2_20220527164334.cpp │ │ │ ├── 2_20220527164337.cpp │ │ │ ├── 2_20220527164338.cpp │ │ │ ├── 2_20220527164350.cpp │ │ │ ├── 2_20220527164445.cpp │ │ │ ├── 2_20220527164520.cpp │ │ │ ├── 2_20220527164529.cpp │ │ │ ├── 2_20220527164552.cpp │ │ │ ├── 2_20220527164600.cpp │ │ │ ├── 2_20220527164616.cpp │ │ │ ├── 2_20220527164620.cpp │ │ │ ├── 2_20220527164638.cpp │ │ │ ├── 2_20220527164655.cpp │ │ │ ├── 2_20220527164704.cpp │ │ │ ├── 2_20220527164753.cpp │ │ │ ├── 2_20220527164800.cpp │ │ │ ├── 2_20220527164803.cpp │ │ │ ├── 2_20220527164835.cpp │ │ │ ├── 2_20220527164949.cpp │ │ │ ├── 2_20220527165001.cpp │ │ │ ├── 2_20220527170803.cpp │ │ │ ├── 2_20220527170859.cpp │ │ │ ├── 2_20220527170916.cpp │ │ │ ├── 2_20220527170921.cpp │ │ │ ├── 2_20220527171406.cpp │ │ │ ├── 2_20220527171424.cpp │ │ │ ├── 2_20220527171439.cpp │ │ │ ├── 2_20220527171451.cpp │ │ │ ├── 2_20220527171505.cpp │ │ │ ├── 2_20220527171511.cpp │ │ │ ├── 2_20220527171524.cpp │ │ │ ├── 2_20220527171540.cpp │ │ │ ├── 2_20220527171545.cpp │ │ │ ├── 2_20220527171548.cpp │ │ │ ├── 2_20220527171604.cpp │ │ │ ├── 2_20220527171737.cpp │ │ │ ├── 2_20220527171910.cpp │ │ │ ├── 2_20220527172302.cpp │ │ │ ├── 2_20220527172548.cpp │ │ │ ├── 2_20220527172558.cpp │ │ │ ├── 2_20220527172732.cpp │ │ │ ├── 2_20220527172757.cpp │ │ │ ├── 2_20220527172815.cpp │ │ │ ├── 2_20220527172820.cpp │ │ │ ├── 2_20220527172920.cpp │ │ │ ├── 2_20220527172925.cpp │ │ │ ├── 2_20220527172946.cpp │ │ │ ├── 2_20220527172958.cpp │ │ │ ├── 2_20220527173029.cpp │ │ │ ├── 2_20220527173036.cpp │ │ │ ├── 2_20220527173055.cpp │ │ │ ├── 2_20220527173109.cpp │ │ │ ├── 2_20220527173128.cpp │ │ │ ├── 2_20220527173133.cpp │ │ │ ├── 2_20220527173219.cpp │ │ │ ├── 2_20220527173247.cpp │ │ │ ├── 2_20220527173310.cpp │ │ │ ├── 2_20220527173336.cpp │ │ │ ├── 2_20220527173412.cpp │ │ │ ├── 2_20220527173414.cpp │ │ │ ├── 2_20220527173420.cpp │ │ │ ├── 2_20220527173425.cpp │ │ │ ├── 2_20220527173508.cpp │ │ │ ├── 2_20220527173637.cpp │ │ │ ├── 2_20220527174909.cpp │ │ │ ├── 2_20220527174924.cpp │ │ │ ├── 2_20220527190259.cpp │ │ │ ├── 2_20220527190506.cpp │ │ │ ├── 2_20220527191429.cpp │ │ │ ├── 2_20220527191519.cpp │ │ │ ├── 2_20220527191523.cpp │ │ │ ├── 2_20220527191606.cpp │ │ │ ├── 2_20220527191623.cpp │ │ │ ├── 2_20220527191637.cpp │ │ │ ├── 2_20220527191827.cpp │ │ │ ├── 2_20220527191837.cpp │ │ │ ├── 2_20220527192001.cpp │ │ │ ├── 2_20220527192020.cpp │ │ │ ├── 2_20220527192028.cpp │ │ │ ├── 2_20220527192029.cpp │ │ │ ├── 2_20220527192101.cpp │ │ │ ├── 2_20220527192113.cpp │ │ │ ├── 2_20220527192157.cpp │ │ │ ├── 2_20220527192204.cpp │ │ │ ├── 2_20220527192218.cpp │ │ │ ├── 2_20220527192220.cpp │ │ │ ├── 2_20220527192234.cpp │ │ │ ├── 2_20220527192244.cpp │ │ │ ├── 2_20220527192329.cpp │ │ │ ├── 2_20220527192337.cpp │ │ │ ├── 2_20220527192410.cpp │ │ │ ├── 2_20220527192444.cpp │ │ │ ├── 2_20220527192557.cpp │ │ │ ├── 2_20220527192726.cpp │ │ │ ├── 2_20220527192941.cpp │ │ │ ├── 2_20220527193307.cpp │ │ │ ├── 2_20220527193416.cpp │ │ │ ├── 2_20220527193512.cpp │ │ │ ├── 2_20220527193536.cpp │ │ │ ├── 2_20220527193537.cpp │ │ │ ├── 2_20220527194059.cpp │ │ │ ├── 2_20220527194101.cpp │ │ │ ├── 2_20220527194120.cpp │ │ │ ├── 2_20220527194224.cpp │ │ │ ├── 2_20220527194238.cpp │ │ │ ├── 2_20220527194352.cpp │ │ │ ├── 2_20220527194414.cpp │ │ │ ├── 2_20220527194446.cpp │ │ │ ├── 2_20220527194450.cpp │ │ │ ├── 2_20220527194527.cpp │ │ │ ├── 2_20220527194600.cpp │ │ │ ├── 2_20220527194629.cpp │ │ │ ├── 2_20220527194644.cpp │ │ │ ├── 2_20220527194657.cpp │ │ │ ├── 2_20220527194705.cpp │ │ │ ├── 2_20220527194709.cpp │ │ │ ├── 2_20220527194713.cpp │ │ │ ├── 2_20220527194735.cpp │ │ │ ├── 2_20220527194749.cpp │ │ │ ├── 2_20220527194947.cpp │ │ │ ├── 2_20220527195054.cpp │ │ │ ├── 2_20220527195529.cpp │ │ │ ├── 2_20220527195530.cpp │ │ │ ├── 2_20220527195544.cpp │ │ │ ├── 2_20220527195624.cpp │ │ │ ├── 2_20220527195634.cpp │ │ │ └── 2_20220527195645.cpp │ │ ├── .vscode │ │ │ ├── 10.txt │ │ │ ├── edit.txt │ │ │ ├── launch.json │ │ │ ├── makefile │ │ │ ├── settings.json │ │ │ └── tasks.json │ │ ├── 1.1.cpp │ │ ├── 1.1.exe │ │ ├── 1.2.cpp │ │ ├── 1.3.cpp │ │ ├── 1.3.exe │ │ ├── 1.4.cpp │ │ ├── 1.4.exe │ │ ├── 1.5.cpp │ │ ├── 1.5.exe │ │ ├── 1.cpp │ │ ├── 1.exe │ │ ├── 2.cpp │ │ └── 2.exe │ ├── 6 │ │ ├── .vscode │ │ │ ├── 10.txt │ │ │ ├── edit.txt │ │ │ ├── launch.json │ │ │ ├── makefile │ │ │ ├── settings.json │ │ │ └── tasks.json │ │ ├── 1.cpp │ │ ├── 1.exe │ │ ├── 2.0.exe │ │ ├── 2.1.cpp │ │ ├── 2.1.exe │ │ ├── 2.best.cpp │ │ ├── 2.cpp │ │ └── 2.exe │ ├── 7 │ │ ├── .history │ │ │ ├── 1.1_20220605174531.cpp │ │ │ ├── 1.1_20220605174534.cpp │ │ │ ├── 1.1_20220605174547.cpp │ │ │ ├── 1.1_20220605174601.cpp │ │ │ ├── 1.1_20220605174750.cpp │ │ │ ├── 1.1_20220605174958.cpp │ │ │ ├── 1.1_20220605175142.cpp │ │ │ ├── 1.1_20220605175143.cpp │ │ │ ├── 1.1_20220605175150.cpp │ │ │ ├── 1.1_20220605175222.cpp │ │ │ ├── 1.1_20220605175236.cpp │ │ │ ├── 1.1_20220605181754.cpp │ │ │ ├── 1.1_20220605181802.cpp │ │ │ ├── 1.1_20220605181808.cpp │ │ │ ├── 1.1_20220605181816.cpp │ │ │ ├── 1.1_20220605181846.cpp │ │ │ ├── 1.1_20220605181904.cpp │ │ │ ├── 1.1_20220605181945.cpp │ │ │ ├── 1.2_20220605175727.cpp │ │ │ ├── 1.2_20220605175735.cpp │ │ │ ├── 1.2_20220605175756.cpp │ │ │ ├── 1.2_20220605175809.cpp │ │ │ ├── 1.2_20220605175823.cpp │ │ │ ├── 1.2_20220605175911.cpp │ │ │ ├── 1.2_20220605180039.cpp │ │ │ ├── 1.2_20220605181135.cpp │ │ │ ├── 1.2_20220605181240.cpp │ │ │ ├── 1_20220605104520.cpp │ │ │ ├── 1_20220605104528.cpp │ │ │ ├── 1_20220605104542.cpp │ │ │ ├── 1_20220605105227.cpp │ │ │ ├── 1_20220605105702.cpp │ │ │ ├── 1_20220605105905.cpp │ │ │ ├── 1_20220605105957.cpp │ │ │ ├── 1_20220605110018.cpp │ │ │ ├── 1_20220605110024.cpp │ │ │ ├── 1_20220605110026.cpp │ │ │ ├── 1_20220605110726.cpp │ │ │ ├── 1_20220605110907.cpp │ │ │ ├── 1_20220605110913.cpp │ │ │ ├── 1_20220605110950.cpp │ │ │ ├── 1_20220605111011.cpp │ │ │ ├── 1_20220605111024.cpp │ │ │ ├── 1_20220605111034.cpp │ │ │ ├── 1_20220605111111.cpp │ │ │ ├── 1_20220605111124.cpp │ │ │ ├── 1_20220605112405.cpp │ │ │ ├── 1_20220605163800.cpp │ │ │ ├── 1_20220605164427.cpp │ │ │ ├── 1_20220605164429.cpp │ │ │ ├── 1_20220605164432.cpp │ │ │ ├── 1_20220605164437.cpp │ │ │ ├── 1_20220605164517.cpp │ │ │ ├── 1_20220605172028.cpp │ │ │ ├── 1_20220605172039.cpp │ │ │ ├── 1_20220605172049.cpp │ │ │ ├── 1_20220605172120.cpp │ │ │ ├── 1_20220605172143.cpp │ │ │ ├── 1_20220605172229.cpp │ │ │ ├── 1_20220605172257.cpp │ │ │ ├── 1_20220605172301.cpp │ │ │ ├── 1_20220605172308.cpp │ │ │ ├── 1_20220605172342.cpp │ │ │ ├── 1_20220605172458.cpp │ │ │ ├── 1_20220605172505.cpp │ │ │ ├── 1_20220605172506.cpp │ │ │ ├── 1_20220605172628.cpp │ │ │ ├── 1_20220605172639.cpp │ │ │ ├── 1_20220605173001.cpp │ │ │ ├── 1_20220605173248.cpp │ │ │ ├── 1_20220605173251.cpp │ │ │ ├── 1_20220605173323.cpp │ │ │ ├── 1_20220605173346.cpp │ │ │ ├── 1_20220605173437.cpp │ │ │ ├── 1_20220605173441.cpp │ │ │ ├── 1_20220605173646.cpp │ │ │ ├── 1_20220605173720.cpp │ │ │ ├── 1_20220605173735.cpp │ │ │ ├── 1_20220605173753.cpp │ │ │ ├── 1_20220605173812.cpp │ │ │ ├── 1_20220605173910.cpp │ │ │ ├── 1_20220605174001.cpp │ │ │ ├── 1_20220605174441.cpp │ │ │ ├── 1_20220605182106.cpp │ │ │ ├── 1_20220605182349.cpp │ │ │ ├── 1_20220605182438.cpp │ │ │ ├── 1_20220605182500.cpp │ │ │ ├── 1_20220605182533.cpp │ │ │ ├── 1_20220605182534.cpp │ │ │ ├── 1_20220605183224.cpp │ │ │ ├── 1_20220605183309.cpp │ │ │ ├── 1_20220605191917.cpp │ │ │ ├── 2.1_20220605204137.cpp │ │ │ ├── 2.1_20220605204146.cpp │ │ │ ├── 2.1_20220605204208.cpp │ │ │ ├── 2.1_20220605204216.cpp │ │ │ ├── 2.1_20220605204221.cpp │ │ │ ├── 2.1_20220605204259.cpp │ │ │ ├── 2.1_20220605204316.cpp │ │ │ ├── 2.1_20220605204400.cpp │ │ │ ├── 2.1_20220605204434.cpp │ │ │ ├── 2.1_20220605204452.cpp │ │ │ ├── 2.1_20220605204514.cpp │ │ │ ├── 2.1_20220605204535.cpp │ │ │ ├── 2.1_20220605204652.cpp │ │ │ ├── 2.1_20220605204823.cpp │ │ │ ├── 2.1_20220605204915.cpp │ │ │ ├── 2.1_20220605204917.cpp │ │ │ ├── 2.1_20220605204925.cpp │ │ │ ├── 2.1_20220605204928.cpp │ │ │ ├── 2.1_20220605204948.cpp │ │ │ ├── 2.1_20220605204950.cpp │ │ │ ├── 2.1_20220605205033.cpp │ │ │ ├── 2.1_20220605205216.cpp │ │ │ ├── 2_20220605111548.cpp │ │ │ ├── 2_20220605111558.cpp │ │ │ ├── 2_20220605200919.cpp │ │ │ ├── 2_20220605200930.cpp │ │ │ ├── 2_20220605201011.cpp │ │ │ ├── 2_20220605201034.cpp │ │ │ ├── 2_20220605201043.cpp │ │ │ ├── 2_20220605201123.cpp │ │ │ ├── 2_20220605201132.cpp │ │ │ ├── 2_20220605201136.cpp │ │ │ ├── 2_20220605201210.cpp │ │ │ ├── 2_20220605201234.cpp │ │ │ ├── 2_20220605201307.cpp │ │ │ ├── 2_20220605201410.cpp │ │ │ ├── 2_20220605201444.cpp │ │ │ ├── 2_20220605201445.cpp │ │ │ ├── 2_20220605201514.cpp │ │ │ ├── 2_20220605201524.cpp │ │ │ ├── 2_20220605201536.cpp │ │ │ ├── 2_20220605201550.cpp │ │ │ ├── 2_20220605201851.cpp │ │ │ ├── 2_20220605202006.cpp │ │ │ ├── 2_20220605202042.cpp │ │ │ ├── 2_20220605202052.cpp │ │ │ ├── 2_20220605202122.cpp │ │ │ ├── 2_20220605202213.cpp │ │ │ ├── 2_20220605202302.cpp │ │ │ ├── 2_20220605202307.cpp │ │ │ ├── 2_20220605202309.cpp │ │ │ ├── 2_20220605202321.cpp │ │ │ ├── 2_20220605203754.cpp │ │ │ ├── 2_20220605203818.cpp │ │ │ └── 2_20220605204133.cpp │ │ ├── .vscode │ │ │ ├── 10.txt │ │ │ ├── edit.txt │ │ │ ├── launch.json │ │ │ ├── makefile │ │ │ ├── settings.json │ │ │ └── tasks.json │ │ ├── 1.1.cpp │ │ ├── 1.1.exe │ │ ├── 1.2.cpp │ │ ├── 1.2.exe │ │ ├── 1.cpp │ │ ├── 1.exe │ │ ├── 2.1.cpp │ │ ├── 2.1.exe │ │ ├── 2.cpp │ │ └── 2.exe │ ├── .vscode │ │ ├── 10.txt │ │ ├── edit.txt │ │ ├── launch.json │ │ ├── makefile │ │ ├── settings.json │ │ └── tasks.json │ ├── Wheels │ │ ├── .history │ │ │ ├── Graph_20220524184200.cpp │ │ │ ├── Graph_20220524184202.cpp │ │ │ ├── Graph_20220524184239.cpp │ │ │ ├── binary_search_20220428152209.cpp │ │ │ ├── binary_search_20220428152219.cpp │ │ │ ├── dfs_20220504200045.cpp │ │ │ ├── dfs_20220504200050.cpp │ │ │ ├── dfs_20220504200202.cpp │ │ │ ├── dfs_20220504200219.cpp │ │ │ ├── dfs_20220504203924.cpp │ │ │ ├── select_20220428150518.cpp │ │ │ ├── select_20220428150521.cpp │ │ │ ├── select_20220428150534.cpp │ │ │ ├── select_20220428150622.cpp │ │ │ ├── select_20220428150636.cpp │ │ │ ├── select_20220504203815.cpp │ │ │ ├── union-find_20220504203857.cpp │ │ │ └── union-find_20220504203922.cpp │ │ ├── Graph.cpp │ │ ├── binary_search.cpp │ │ ├── dfs.cpp │ │ ├── select.cpp │ │ └── union-find.cpp │ └── 回形排序相关说明.pdf ├── Homework │ └── friends │ │ ├── IMG_2833.JPG │ │ ├── IMG_2834.JPG │ │ ├── IMG_2835.JPG │ │ ├── IMG_2836.JPG │ │ ├── IMG_2837.JPG │ │ ├── IMG_2838.JPG │ │ ├── IMG_2839.JPG │ │ ├── IMG_2840.JPG │ │ ├── IMG_2841.JPG │ │ ├── IMG_2842.JPG │ │ ├── IMG_2843.JPG │ │ ├── IMG_2844.JPG │ │ ├── IMG_2845.JPG │ │ ├── IMG_2846.JPG │ │ ├── IMG_2847.JPG │ │ ├── IMG_3033.JPG │ │ ├── IMG_3034.JPG │ │ ├── IMG_3035.JPG │ │ ├── IMG_3036.JPG │ │ └── IMG_3037.JPG ├── README.md ├── 南大2015级算法课件 - 快捷方式.lnk ├── 总复习 │ ├── 算法复习.md │ └── 算法设计与分析 期末.pdf ├── 笔记 │ ├── Algorithm U1.md │ ├── Algorithm U3--recursion.md │ ├── Algorithm U4 -- divide.md │ ├── Algorithm U6 L8.md │ ├── Algorithm U8 Graph.md │ └── 查找数组中第k大的数.md ├── 答案 │ ├── P1~P3 & OJ1~OJ3习题讲解.pdf │ ├── P1~P3要点总结.pdf │ ├── P4~7.pdf │ ├── P7(1).pdf │ └── 算法答案csdn(助教已删除.pdf ├── 试卷 │ ├── 201220058_王珊.pdf │ ├── 2022年春季-期中试题.docx │ ├── 期中考试参考答案.pdf │ ├── 期中试卷讲解.pdf │ └── 样题 │ │ ├── QQ图片20220617162659.jpg │ │ ├── QQ图片20220617162810.jpg │ │ └── QQ图片20220617162818.jpg └── 课件 │ ├── L1 - Model of computation.pdf │ ├── L2 - Asymptotics(1).pdf │ ├── L3 - Recursion(1).pdf │ ├── L4 - QuickSort.pdf │ ├── L5 - HeapSort.pdf │ └── L7 - Selection(1).pdf └── README.md /Algorithm算法/Code/.vscode/10.txt: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | using namespace std; 7 | int main() 8 | { 9 | 10 | system("pause"); 11 | return 0; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /Algorithm算法/Code/.vscode/edit.txt: -------------------------------------------------------------------------------- 1 | 2021暑期活动纪录片 -------------------------------------------------------------------------------- /Algorithm算法/Code/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "g++.exe - 生成和调试活动文件", 9 | "type": "cppdbg", 10 | "request": "launch", 11 | "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", 12 | "args": [], 13 | "stopAtEntry": false, 14 | "cwd": "D:\\mingw64\\bin\\", 15 | "environment": [], 16 | "externalConsole": true, 17 | "MIMode": "gdb", 18 | "miDebuggerPath": "D:\\mingw64\\bin\\gdb.exe", 19 | "setupCommands": [ 20 | { 21 | "description": "为 gdb 启用整齐打印", 22 | "text": "-enable-pretty-printing", 23 | "ignoreFailures": true 24 | } 25 | ], 26 | "preLaunchTask": "C/C++: g++.exe build active file" 27 | } 28 | ] 29 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/.vscode/makefile: -------------------------------------------------------------------------------- 1 | obj=main.o 2 | target = main 3 | CC = g++ 4 | 5 | $(target) : $(obj) 6 | 7 | $(CC) $(obj) -o $(target) 8 | 9 | %.o :%.cpp 10 | $(CC) $< -c -o $@ -g 11 | 12 | clean: 13 | rm *.o main -------------------------------------------------------------------------------- /Algorithm算法/Code/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "iostream": "cpp", 4 | "xstring": "cpp", 5 | "string": "cpp", 6 | "xutility": "cpp" 7 | } 8 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "tasks": [ 3 | { 4 | "type": "cppbuild", 5 | "label": "C/C++: g++.exe build active file", 6 | "command": "D:\\mingw64\\bin\\g++.exe", 7 | "args": [ 8 | "-g", 9 | "${file}", 10 | "-o", 11 | "${fileDirname}\\${fileBasenameNoExtension}.exe", 12 | "-std=c++17" 13 | ], 14 | "options": { 15 | "cwd": "D:\\mingw64\\bin" 16 | }, 17 | "problemMatcher": [ 18 | "$gcc" 19 | ], 20 | "group": { 21 | "kind": "build", 22 | "isDefault": true 23 | }, 24 | "detail": "Task generated by Debugger." 25 | } 26 | ], 27 | "version": "2.0.0" 28 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/1/.vscode/10.txt: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | using namespace std; 7 | int main() 8 | { 9 | 10 | system("pause"); 11 | return 0; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /Algorithm算法/Code/1/.vscode/edit.txt: -------------------------------------------------------------------------------- 1 | int partition(int a[], int l, int r) // basic partition 2 | { 3 | int i = l; 4 | int j = r; 5 | int pivot = t(l,a); 6 | while (i < j) 7 | { 8 | while (t(j,a) >= pivot && i < j) 9 | j--; 10 | t(i,a) = t(j,a); 11 | while (t(i,a) <= pivot && i < j) 12 | i++; 13 | t(j,a) = t(i,a); 14 | } 15 | t(i,a) = pivot; 16 | return i; 17 | } 18 | 19 | int partition(int a[], int l, int r) // basic partition 20 | { 21 | int i = l; 22 | int j = r; 23 | int pivot = a[l]; 24 | while (i < j) 25 | { 26 | while (t(j,a) >= pivot && i < j) 27 | j--; 28 | a[i] = a[j]; 29 | while (a[i] <= pivot && i < j) 30 | i++; 31 | a[j] = a[i]; 32 | } 33 | a[i] = pivot; 34 | return i; 35 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/1/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "g++.exe - 生成和调试活动文件", 9 | "type": "cppdbg", 10 | "request": "launch", 11 | "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", 12 | "args": [], 13 | "stopAtEntry": false, 14 | "cwd": "D:\\mingw64\\bin\\", 15 | "environment": [], 16 | "externalConsole": true, 17 | "MIMode": "gdb", 18 | "miDebuggerPath": "D:\\mingw64\\bin\\gdb.exe", 19 | "setupCommands": [ 20 | { 21 | "description": "为 gdb 启用整齐打印", 22 | "text": "-enable-pretty-printing", 23 | "ignoreFailures": true 24 | } 25 | ], 26 | "preLaunchTask": "C/C++: g++.exe build active file" 27 | } 28 | ] 29 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/1/.vscode/makefile: -------------------------------------------------------------------------------- 1 | obj=main.o 2 | target = main 3 | CC = g++ 4 | 5 | $(target) : $(obj) 6 | 7 | $(CC) $(obj) -o $(target) 8 | 9 | %.o :%.cpp 10 | $(CC) $< -c -o $@ -g 11 | 12 | clean: 13 | rm *.o main -------------------------------------------------------------------------------- /Algorithm算法/Code/1/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "iostream": "cpp", 4 | "xstring": "cpp", 5 | "string": "cpp", 6 | "xutility": "cpp", 7 | "utility": "cpp", 8 | "algorithm": "cpp" 9 | } 10 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/1/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "tasks": [ 3 | { 4 | "type": "cppbuild", 5 | "label": "C/C++: g++.exe build active file", 6 | "command": "D:\\mingw64\\bin\\g++.exe", 7 | "args": [ 8 | "-g", 9 | "${file}", 10 | "-o", 11 | "${fileDirname}\\${fileBasenameNoExtension}.exe", 12 | "-std=c++17" 13 | ], 14 | "options": { 15 | "cwd": "D:\\mingw64\\bin" 16 | }, 17 | "problemMatcher": [ 18 | "$gcc" 19 | ], 20 | "group": { 21 | "kind": "build", 22 | "isDefault": true 23 | }, 24 | "detail": "Task generated by Debugger." 25 | } 26 | ], 27 | "version": "2.0.0" 28 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/1/1.4.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/1/1.4.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/1/2.1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/1/2.1.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/1/2.2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/1/2.2.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/1/2.3.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/1/2.3.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/2/.vscode/10.txt: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | using namespace std; 7 | int main() 8 | { 9 | 10 | system("pause"); 11 | return 0; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /Algorithm算法/Code/2/.vscode/edit.txt: -------------------------------------------------------------------------------- 1 | 2021暑期活动纪录片 -------------------------------------------------------------------------------- /Algorithm算法/Code/2/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "g++.exe - 生成和调试活动文件", 9 | "type": "cppdbg", 10 | "request": "launch", 11 | "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", 12 | "args": [], 13 | "stopAtEntry": false, 14 | "cwd": "D:\\mingw64\\bin\\", 15 | "environment": [], 16 | "externalConsole": true, 17 | "MIMode": "gdb", 18 | "miDebuggerPath": "D:\\mingw64\\bin\\gdb.exe", 19 | "setupCommands": [ 20 | { 21 | "description": "为 gdb 启用整齐打印", 22 | "text": "-enable-pretty-printing", 23 | "ignoreFailures": true 24 | } 25 | ], 26 | "preLaunchTask": "C/C++: g++.exe build active file" 27 | } 28 | ] 29 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/2/.vscode/makefile: -------------------------------------------------------------------------------- 1 | obj=main.o 2 | target = main 3 | CC = g++ 4 | 5 | $(target) : $(obj) 6 | 7 | $(CC) $(obj) -o $(target) 8 | 9 | %.o :%.cpp 10 | $(CC) $< -c -o $@ -g 11 | 12 | clean: 13 | rm *.o main -------------------------------------------------------------------------------- /Algorithm算法/Code/2/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "iostream": "cpp", 4 | "xstring": "cpp", 5 | "string": "cpp", 6 | "xutility": "cpp", 7 | "vector": "cpp", 8 | "xlocale": "cpp", 9 | "atomic": "cpp", 10 | "bit": "cpp", 11 | "cctype": "cpp", 12 | "clocale": "cpp", 13 | "cmath": "cpp", 14 | "compare": "cpp", 15 | "concepts": "cpp", 16 | "cstddef": "cpp", 17 | "cstdint": "cpp", 18 | "cstdio": "cpp", 19 | "cstdlib": "cpp", 20 | "cstring": "cpp", 21 | "ctime": "cpp", 22 | "cwchar": "cpp", 23 | "exception": "cpp", 24 | "initializer_list": "cpp", 25 | "ios": "cpp", 26 | "iosfwd": "cpp", 27 | "istream": "cpp", 28 | "iterator": "cpp", 29 | "limits": "cpp", 30 | "memory": "cpp", 31 | "new": "cpp", 32 | "ostream": "cpp", 33 | "stdexcept": "cpp", 34 | "streambuf": "cpp", 35 | "system_error": "cpp", 36 | "tuple": "cpp", 37 | "type_traits": "cpp", 38 | "typeinfo": "cpp", 39 | "utility": "cpp", 40 | "xfacet": "cpp", 41 | "xiosbase": "cpp", 42 | "xlocinfo": "cpp", 43 | "xlocnum": "cpp", 44 | "xmemory": "cpp", 45 | "xstddef": "cpp", 46 | "xtr1common": "cpp" 47 | } 48 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/2/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "tasks": [ 3 | { 4 | "type": "cppbuild", 5 | "label": "C/C++: g++.exe build active file", 6 | "command": "D:\\mingw64\\bin\\g++.exe", 7 | "args": [ 8 | "-g", 9 | "${file}", 10 | "-o", 11 | "${fileDirname}\\${fileBasenameNoExtension}.exe", 12 | "-std=c++17" 13 | ], 14 | "options": { 15 | "cwd": "D:\\mingw64\\bin" 16 | }, 17 | "problemMatcher": [ 18 | "$gcc" 19 | ], 20 | "group": { 21 | "kind": "build", 22 | "isDefault": true 23 | }, 24 | "detail": "Task generated by Debugger." 25 | } 26 | ], 27 | "version": "2.0.0" 28 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/2/1.2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/2/1.2.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/2/1.3.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/2/1.3.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/2/1.31.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/2/1.31.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/2/1.4.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/2/1.4.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/2/1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/2/1.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/2/2 3.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/2/2 3.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/2/2.1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/2/2.1.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/2/2.2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/2/2.2.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/2/2.3.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/2/2.3.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/2/2.4.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/2/2.4.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/2/2.5.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/2/2.5.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/2/2.6.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/2/2.6.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/2/2.7.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/2/2.7.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/2/2.8.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/2/2.8.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/2/2.9.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/2/2.9.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/2/2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/2/2.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424161938.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/3/.history/1_20220424161938.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424161949.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | using namespace std; 7 | int main() 8 | { 9 | 10 | system("pause"); 11 | return 0; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424161959.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int main() 46 | { 47 | 48 | system("pause"); 49 | return 0; 50 | } 51 | 52 | 53 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162057.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int f[10000]; 46 | 47 | int find(int x) 48 | { 49 | if (f[x] != x) 50 | f[x] = find(f[x]); 51 | return f[x]; 52 | } 53 | 54 | void merge(int x, int y) 55 | { 56 | int fx = find(f[x]); 57 | int fy = find(f[y]); 58 | f[fx] = fy; 59 | } 60 | int main() 61 | { 62 | 63 | system("pause"); 64 | return 0; 65 | } 66 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162234.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int f[10000]; 46 | 47 | int find(int x) 48 | { 49 | if (f[x] != x) 50 | f[x] = find(f[x]); 51 | return f[x]; 52 | } 53 | 54 | void merge(int x, int y) 55 | { 56 | int fx = find(f[x]); 57 | int fy = find(f[y]); 58 | f[fx] = fy; 59 | } 60 | int main() 61 | { 62 | int n, m; 63 | cin >> n >> m; 64 | for (int i = 0; i < n; i++) 65 | { 66 | /* code */ 67 | } 68 | ) 69 | 70 | system("pause"); 71 | return 0; 72 | } 73 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162257.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int f[1000000]; 46 | 47 | int find(int x) 48 | { 49 | if (f[x] != x) 50 | f[x] = find(f[x]); 51 | return f[x]; 52 | } 53 | 54 | void merge(int x, int y) 55 | { 56 | int fx = find(f[x]); 57 | int fy = find(f[y]); 58 | f[fx] = fy; 59 | } 60 | int main() 61 | { 62 | int n, m; 63 | cin >> n >> m; 64 | for (int i = 0; i < n; i++) 65 | { 66 | /* code */ 67 | } 68 | 69 | 70 | system("pause"); 71 | return 0; 72 | } 73 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162348.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x],f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y,int f[]) 53 | { 54 | int fx = find(f[x],f); 55 | int fy = find(f[y],f); 56 | f[fx] = fy; 57 | } 58 | int main() 59 | { 60 | int n, m; 61 | cin >> n >> m; 62 | for (int i = 0; i < n; i++) 63 | { 64 | /* code */ 65 | } 66 | 67 | 68 | system("pause"); 69 | return 0; 70 | } 71 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162350.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | int main() 59 | { 60 | int n, m; 61 | cin >> n >> m; 62 | for (int i = 0; i < n; i++) 63 | { 64 | /* code */ 65 | } 66 | 67 | system("pause"); 68 | return 0; 69 | } 70 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162413.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | int main() 59 | { 60 | int n, m; 61 | cin >> n >> m; 62 | f = new int[n] for (int i = 0; i < n; i++) 63 | { 64 | /* code */ 65 | } 66 | 67 | system("pause"); 68 | return 0; 69 | } 70 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162421.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | int main() 59 | { 60 | int n, m; 61 | cin >> n >> m; 62 | int *f = new int[n]; 63 | for (int i = 0; i < n; i++) 64 | { 65 | /* code */ 66 | } 67 | 68 | system("pause"); 69 | return 0; 70 | } 71 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162454.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | int main() 59 | { 60 | int n, m; 61 | cin >> n >> m; 62 | int *f = new int[n]; 63 | for (int i = 0; i < m; i++) 64 | { 65 | int x, y, z; 66 | cin >> x >> y >> z; 67 | } 68 | 69 | system("pause"); 70 | return 0; 71 | } 72 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162517.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | int main() 59 | { 60 | int n, m; 61 | cin >> n >> m; 62 | int *f = new int[n]; 63 | for (int i = 0; i < m; i++) 64 | { 65 | int x, y, z; 66 | cin >> x >> y >> z; 67 | if (z == 1) 68 | merge(z, y, f); 69 | else 70 | } 71 | 72 | system("pause"); 73 | return 0; 74 | } 75 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162530.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | int main() 59 | { 60 | int n, m; 61 | cin >> n >> m; 62 | int *f = new int[n]; 63 | for (int i = 0; i < m; i++) 64 | { 65 | int x, y, z; 66 | cin >> z >> x >> y; 67 | if (z == 1) 68 | merge(z, y, f); 69 | else 70 | } 71 | 72 | system("pause"); 73 | return 0; 74 | } 75 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162538.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | int main() 59 | { 60 | int n, m; 61 | cin >> n >> m; 62 | int *f = new int[n]; 63 | for (int i = 0; i < m; i++) 64 | { 65 | int x, y, z; 66 | cin >> z >> x >> y; 67 | if (z == 1) 68 | merge(z, y, f); 69 | else 70 | } 71 | 72 | system("pause"); 73 | return 0; 74 | } 75 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162639.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | int main() 59 | { 60 | int n, m; 61 | cin >> n >> m; 62 | int *f = new int[n]; 63 | for (int i = 0; i < m; i++) 64 | { 65 | int x, y, z; 66 | cin >> z >> x >> y; 67 | if (z == 1) 68 | merge(z, y, f); 69 | else 70 | { 71 | int tmp = find(x, f) == find(y, f); 72 | if (tmp) 73 | cout << "Y"< 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | int main() 59 | { 60 | int n, m; 61 | cin >> n >> m; 62 | int *f = new int[n]; 63 | for (int i = 0; i < m; i++) 64 | { 65 | int x, y, z; 66 | cin >> z >> x >> y; 67 | if (z == 1) 68 | merge(z, y, f); 69 | else 70 | { 71 | int tmp = find(x, f) == find(y, f); 72 | if (tmp) 73 | cout << "Y" << endl; 74 | else 75 | cout << "N" << endl; 76 | } 77 | } 78 | 79 | system("pause"); 80 | return 0; 81 | } 82 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162709.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | int main() 59 | { 60 | int n, m; 61 | cin >> n >> m; 62 | int *f = new int[n]; 63 | for (int i = 0; i < n; i++) 64 | f[i] = i; 65 | 66 | for (int i = 0; i < m; i++) 67 | { 68 | int x, y, z; 69 | cin >> z >> x >> y; 70 | if (z == 1) 71 | merge(z, y, f); 72 | else 73 | { 74 | int tmp = find(x, f) == find(y, f); 75 | if (tmp) 76 | cout << "Y" << endl; 77 | else 78 | cout << "N" << endl; 79 | } 80 | } 81 | 82 | system("pause"); 83 | return 0; 84 | } 85 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162720.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | int main() 59 | { 60 | int n, m; 61 | cin >> n >> m; 62 | int *f = new int[n]; 63 | for (int i = 0; i < n; i++) 64 | f[i] = i; 65 | for (int i = 0; i < m; i++) 66 | { 67 | int x, y, z; 68 | cin >> z >> x >> y; 69 | if (z == 1) 70 | merge(z, y, f); 71 | else 72 | { 73 | int tmp = find(x, f) == find(y, f); 74 | if (tmp) 75 | cout << "Y" << endl; 76 | else 77 | cout << "N" << endl; 78 | } 79 | } 80 | 81 | system("pause"); 82 | return 0; 83 | } 84 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162815.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | int main() 59 | { 60 | int n, m; 61 | cin >> n >> m; 62 | int *f = new int[n+1]; 63 | for (int i = 0; i < n; i++) 64 | f[i] = i; 65 | for (int i = 0; i < m; i++) 66 | { 67 | int x, y, z; 68 | cin >> z >> x >> y; 69 | if (z == 1) 70 | merge(z, y, f); 71 | else 72 | { 73 | int tmp = find(x, f) == find(y, f); 74 | if (tmp) 75 | cout << "Y" << endl; 76 | else 77 | cout << "N" << endl; 78 | } 79 | } 80 | 81 | system("pause"); 82 | return 0; 83 | } 84 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162816.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | int main() 59 | { 60 | int n, m; 61 | cin >> n >> m; 62 | int *f = new int[n+1]; 63 | for (int i = 0; i < n; i++) 64 | f[i] = i; 65 | for (int i = 0; i < m; i++) 66 | { 67 | int x, y, z; 68 | cin >> z >> x >> y; 69 | if (z == 1) 70 | merge(z, y, f); 71 | else 72 | { 73 | int tmp = find(x, f) == find(y, f); 74 | if (tmp) 75 | cout << "Y" << endl; 76 | else 77 | cout << "N" << endl; 78 | } 79 | } 80 | 81 | system("pause"); 82 | return 0; 83 | } 84 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162854.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | 59 | int main() 60 | { 61 | int n, m; 62 | cin >> n >> m; 63 | int *f = new int[n + 1]; 64 | for (int i = 0; i < n; i++) 65 | f[i] = i; 66 | for (int i = 0; i < m; i++) 67 | { 68 | int x, y, z; 69 | cin >> z >> x >> y; 70 | if (z == 1) 71 | merge(z, y, f); 72 | else 73 | { 74 | int tmp = find(x, f) == find(y, f); 75 | if (tmp) 76 | cout << "Y" << endl; 77 | else 78 | cout << "N" << endl; 79 | } 80 | } 81 | 82 | system("pause"); 83 | return 0; 84 | } 85 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424162919.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | 59 | int main() 60 | { 61 | int n, m; 62 | cin >> n >> m; 63 | int *f = new int[n + 1]; 64 | for (int i = 0; i <= n; i++) 65 | f[i] = i; 66 | for (int i = 0; i < m; i++) 67 | { 68 | int x, y, z; 69 | cin >> z >> x >> y; 70 | if (z == 1) 71 | merge(z, y, f); 72 | else 73 | { 74 | int tmp = find(x, f) == find(y, f); 75 | if (tmp) 76 | cout << "Y" << endl; 77 | else 78 | cout << "N" << endl; 79 | } 80 | } 81 | 82 | system("pause"); 83 | return 0; 84 | } 85 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424163004.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | 59 | int main() 60 | { 61 | int n, m; 62 | cin >> n >> m; 63 | int *f = new int[n + 1]; 64 | for (int i = 0; i <= n; i++) 65 | f[i] = i; 66 | for (int i = 0; i < m; i++) 67 | { 68 | int x, y, z; 69 | cin >> z >> x >> y; 70 | if (z == 1) 71 | merge(z, y, f); 72 | else 73 | { 74 | int tmp = (find(x, f) == find(y, f)); 75 | if (tmp) 76 | cout << "Y" << endl; 77 | else 78 | cout << "N" << endl; 79 | } 80 | } 81 | 82 | system("pause"); 83 | return 0; 84 | } 85 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424163433.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | 59 | int main() 60 | { 61 | int n, m; 62 | cin >> n >> m; 63 | int *f = new int[n + 1]; 64 | int *ans = new int[m + 1] for (int i = 0; i <= n; i++) 65 | f[i] = i; 66 | for (int i = 0; i < m; i++) 67 | { 68 | int x, y, z; 69 | cin >> z >> x >> y; 70 | if (z == 1) 71 | merge(x, y, f); 72 | else 73 | { 74 | int tmp = (find(x, f) == find(y, f)); 75 | if (tmp) 76 | cout << "Y" << endl; 77 | else 78 | cout << "N" << endl; 79 | } 80 | } 81 | 82 | system("pause"); 83 | return 0; 84 | } 85 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424163502.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | 59 | int main() 60 | { 61 | int n, m; 62 | cin >> n >> m; 63 | int *f = new int[n + 1]; 64 | int *ans = new int[m]; 65 | for (int i = 0; i <= n; i++) 66 | f[i] = i; 67 | int count = 0; 68 | for (int i = 0; i < m; i++) 69 | { 70 | int x, y, z; 71 | cin >> z >> x >> y; 72 | if (z == 1) 73 | merge(x, y, f); 74 | else 75 | { 76 | int tmp = (find(x, f) == find(y, f)); 77 | if (tmp) 78 | cout << "Y" << endl; 79 | else 80 | cout << "N" << endl; 81 | } 82 | } 83 | 84 | system("pause"); 85 | return 0; 86 | } 87 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424163610.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | 59 | int main() 60 | { 61 | int n, m; 62 | cin >> n >> m; 63 | int *f = new int[n + 1]; 64 | char *ans = new int[m]; 65 | for (int i = 0; i <= n; i++) 66 | f[i] = i; 67 | int count = 0; 68 | for (int i = 0; i < m; i++) 69 | { 70 | int x, y, z; 71 | cin >> z >> x >> y; 72 | if (z == 1) 73 | merge(x, y, f); 74 | else 75 | { 76 | int tmp = (find(x, f) == find(y, f)); 77 | if (tmp) 78 | ans[count] = 'Y'; 79 | else 80 | ans[count] = 'N'; 81 | } 82 | } 83 | 84 | system("pause"); 85 | return 0; 86 | } 87 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424163632.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | 59 | int main() 60 | { 61 | int n, m; 62 | cin >> n >> m; 63 | int *f = new int[n + 1]; 64 | char *ans = new int[m]; 65 | for (int i = 0; i <= n; i++) 66 | f[i] = i; 67 | int count = 0; 68 | for (int i = 0; i < m; i++) 69 | { 70 | int x, y, z; 71 | cin >> z >> x >> y; 72 | if (z == 1) 73 | merge(x, y, f); 74 | else 75 | { 76 | int tmp = (find(x, f) == find(y, f)); 77 | if (tmp) 78 | ans[count] = 'Y'; 79 | else 80 | ans[count] = 'N'; 81 | } 82 | } 83 | 84 | system("pause"); 85 | return 0; 86 | } 87 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424163633.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | 59 | int main() 60 | { 61 | int n, m; 62 | cin >> n >> m; 63 | int *f = new int[n + 1]; 64 | char *ans = new int[m]; 65 | for (int i = 0; i <= n; i++) 66 | f[i] = i; 67 | int count = 0; 68 | for (int i = 0; i < m; i++) 69 | { 70 | int x, y, z; 71 | cin >> z >> x >> y; 72 | if (z == 1) 73 | merge(x, y, f); 74 | else 75 | { 76 | int tmp = (find(x, f) == find(y, f)); 77 | if (tmp) 78 | ans[count] = 'Y'; 79 | else 80 | ans[count] = 'N'; 81 | } 82 | } 83 | 84 | system("pause"); 85 | return 0; 86 | } 87 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/1_20220424163707.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:并查集 4 | 5 | 题目描述: 6 | 7 | 如题,现在有一个并查集,你需要完成合并和查询操作。 8 | 9 | 输入格式 10 | 第一行包含两个整数N,M,表示共有N个元素和M个操作。 11 | 接下来M行,每行三个整数Zi,Xi,Yi。 12 | 当Zi=1时,将Xi与Yi所在的集合合并。 13 | 当Zi=2时,输出Xi与Yi是否在同一集合内,是的输出Y;否则输出N。 14 | 15 | 输出格式 16 | 对于每个Zi=2的操作,都有一行输出,每行包含一个大写字母,为Y或者N。 17 | 18 | 样例输入 19 | 4 7 20 | 2 1 2 21 | 1 1 2 22 | 2 1 2 23 | 1 3 4 24 | 2 1 4 25 | 1 2 3 26 | 2 1 4 27 | 28 | 样例输出 29 | N 30 | Y 31 | N 32 | Y 33 | 34 | 数据范围 35 | 1 <= N <= 10^6 36 | 1 <= M <= 10^6 37 | 1 <= Xi, Yi <= N 38 | Zi = 1 or 2 39 | 40 | 语言: 41 | */ 42 | #include 43 | #include "stdio.h" 44 | using namespace std; 45 | int find(int x, int f[]) 46 | { 47 | if (f[x] != x) 48 | f[x] = find(f[x], f); 49 | return f[x]; 50 | } 51 | 52 | void merge(int x, int y, int f[]) 53 | { 54 | int fx = find(f[x], f); 55 | int fy = find(f[y], f); 56 | f[fx] = fy; 57 | } 58 | 59 | int main() 60 | { 61 | int n, m; 62 | cin >> n >> m; 63 | int *f = new int[n + 1]; 64 | char *ans = new char[m]; 65 | for (int i = 0; i <= n; i++) 66 | f[i] = i; 67 | int count = 0; 68 | for (int i = 0; i < m; i++) 69 | { 70 | int x, y, z; 71 | cin >> z >> x >> y; 72 | if (z == 1) 73 | merge(x, y, f); 74 | else 75 | { 76 | int tmp = (find(x, f) == find(y, f)); 77 | if (tmp) 78 | ans[count] = 'Y'; 79 | else 80 | ans[count] = 'N'; 81 | } 82 | } 83 | 84 | system("pause"); 85 | return 0; 86 | } 87 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/2_20220424163916.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/3/.history/2_20220424163916.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/2_20220424163926.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | using namespace std; 7 | int main() 8 | { 9 | 10 | system("pause"); 11 | return 0; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/2_20220424163936.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:做作业 4 | 5 | 题目描述: 6 | 7 | 假设算法课开学就布置好了一学期的作业,共N章课后习题,第i章的习题量为homework[i] (1 ≤ i ≤ N),要求在一学期之内(共W周)做完 8 | 9 | 现在你准备制定一个做作业的计划,规定自己每周做K道题,但是有些限制条件需要考虑: 10 | 11 | ① 由于老师1周只讲1章新的内容,因此第i周结束时最多能做完前i章的题; 12 | 13 | ② 由于期中考试周(第⌊W/2⌋周)和期末考试周(第W周)需要复习已做过的题,因此这两周不做新题; 14 | 15 | 为了每周末能按时赶去跳广场舞,你想尽量减小每周的题量K,但是又得保证在ddl前做完所有作业,请设计一个算法,帮助自己找到满足以上所有条件的K的最小值 16 | 17 | 提示1: 18 | 19 | 输入格式: 20 | 21 | 第一行依次为数组homework的大小N、一学期的周数W,二者以一个空格间隔,末尾无空格 22 | 23 | 第二行为数组homework,相邻元素之间以一个空格间隔,末尾无空格 24 | 25 | 输出格式: 26 | 27 | 一个正整数,即K的最小值 28 | 29 | 提示2: 30 | 31 | 输入样例1: 32 | 33 | 6 8 34 | 35 | 3 4 5 6 2 1 36 | 37 | 输出样例1: 38 | 39 | 4 40 | 41 | 样例1解释: 42 | 43 | ① 若K=4:前2周显然全部做完 => 第3周5题做了4道,还剩1道 => 第4周期中考试,复习不做题,累计1+6=7道题没做 => 第5周做题前累计可做7+2=9道,做了4道,还剩5道 => 第6周做题前累计可做5+1=6道,做了4道,还剩2道 => 第7周做题前所有作业还剩2道,可全部做完 => 第8周期末考试,复习不做题 => 学期结束后做完所有作业,满足条件 44 | 45 | ② 若K=3:第一周刚好做完 => 第2周4题做了3道,还剩1道 => 第3周做题前累计可做1+5=6道,做了3道,还剩3道 => 第4周期中考试,复习不做题,累计3+6=9道题没做 => 第5周做题前累计可做9+2=11道,做了3道,还剩8道 => 第6周做题前累计可做8+1=9道,做了3道,还剩6道 => 第7周做题前所有作业还剩6道,做了3道,还剩3道 => 第8周期末考试,复习不做题 => 学期结束后还有3道题没做,不满足条件 46 | 47 | 综合①②:K ≥ 4 => Kmin = 4 48 | 49 | 提示3: 50 | 51 | 1 ≤ N < W < 2N ≤ 10^6 52 | 53 | 数组homework中任意元素hi满足:1 ≤ hi ≤ N 54 | 55 | 提示4: 56 | 57 | 要求:算法的时间复杂度应该不超过O(NlogN) 58 | 59 | 语言: 60 | */ 61 | #include 62 | #include "stdio.h" 63 | using namespace std; 64 | int main() 65 | { 66 | 67 | system("pause"); 68 | return 0; 69 | } 70 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/2_20220424164147.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:做作业 4 | 5 | 题目描述: 6 | 7 | 假设算法课开学就布置好了一学期的作业,共N章课后习题,第i章的习题量为homework[i] (1 ≤ i ≤ N),要求在一学期之内(共W周)做完 8 | 9 | 现在你准备制定一个做作业的计划,规定自己每周做K道题,但是有些限制条件需要考虑: 10 | 11 | ① 由于老师1周只讲1章新的内容,因此第i周结束时最多能做完前i章的题; 12 | 13 | ② 由于期中考试周(第⌊W/2⌋周)和期末考试周(第W周)需要复习已做过的题,因此这两周不做新题; 14 | 15 | 为了每周末能按时赶去跳广场舞,你想尽量减小每周的题量K,但是又得保证在ddl前做完所有作业,请设计一个算法,帮助自己找到满足以上所有条件的K的最小值 16 | 17 | 提示1: 18 | 19 | 输入格式: 20 | 21 | 第一行依次为数组homework的大小N、一学期的周数W,二者以一个空格间隔,末尾无空格 22 | 23 | 第二行为数组homework,相邻元素之间以一个空格间隔,末尾无空格 24 | 25 | 输出格式: 26 | 27 | 一个正整数,即K的最小值 28 | 29 | 提示2: 30 | 31 | 输入样例1: 32 | 33 | 6 8 34 | 35 | 3 4 5 6 2 1 36 | 37 | 输出样例1: 38 | 39 | 4 40 | 41 | 样例1解释: 42 | 43 | ① 若K=4:前2周显然全部做完 => 第3周5题做了4道,还剩1道 => 第4周期中考试,复习不做题,累计1+6=7道题没做 => 第5周做题前累计可做7+2=9道,做了4道,还剩5道 => 第6周做题前累计可做5+1=6道,做了4道,还剩2道 => 第7周做题前所有作业还剩2道,可全部做完 => 第8周期末考试,复习不做题 => 学期结束后做完所有作业,满足条件 44 | 45 | ② 若K=3:第一周刚好做完 => 第2周4题做了3道,还剩1道 => 第3周做题前累计可做1+5=6道,做了3道,还剩3道 => 第4周期中考试,复习不做题,累计3+6=9道题没做 => 第5周做题前累计可做9+2=11道,做了3道,还剩8道 => 第6周做题前累计可做8+1=9道,做了3道,还剩6道 => 第7周做题前所有作业还剩6道,做了3道,还剩3道 => 第8周期末考试,复习不做题 => 学期结束后还有3道题没做,不满足条件 46 | 47 | 综合①②:K ≥ 4 => Kmin = 4 48 | 49 | 提示3: 50 | 51 | 1 ≤ N < W < 2N ≤ 10^6 52 | 53 | 数组homework中任意元素hi满足:1 ≤ hi ≤ N 54 | 55 | 提示4: 56 | 57 | 要求:算法的时间复杂度应该不超过O(NlogN) 58 | 59 | 语言: 60 | */ 61 | #include 62 | #include "stdio.h" 63 | using namespace std; 64 | int main() 65 | { 66 | int n, w; 67 | cin >> n >> w; 68 | 69 | system("pause"); 70 | return 0; 71 | } 72 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/2_20220424164150.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:做作业 4 | 5 | 题目描述: 6 | 7 | 假设算法课开学就布置好了一学期的作业,共N章课后习题,第i章的习题量为homework[i] (1 ≤ i ≤ N),要求在一学期之内(共W周)做完 8 | 9 | 现在你准备制定一个做作业的计划,规定自己每周做K道题,但是有些限制条件需要考虑: 10 | 11 | ① 由于老师1周只讲1章新的内容,因此第i周结束时最多能做完前i章的题; 12 | 13 | ② 由于期中考试周(第⌊W/2⌋周)和期末考试周(第W周)需要复习已做过的题,因此这两周不做新题; 14 | 15 | 为了每周末能按时赶去跳广场舞,你想尽量减小每周的题量K,但是又得保证在ddl前做完所有作业,请设计一个算法,帮助自己找到满足以上所有条件的K的最小值 16 | 17 | 提示1: 18 | 19 | 输入格式: 20 | 21 | 第一行依次为数组homework的大小N、一学期的周数W,二者以一个空格间隔,末尾无空格 22 | 23 | 第二行为数组homework,相邻元素之间以一个空格间隔,末尾无空格 24 | 25 | 输出格式: 26 | 27 | 一个正整数,即K的最小值 28 | 29 | 提示2: 30 | 31 | 输入样例1: 32 | 33 | 6 8 34 | 35 | 3 4 5 6 2 1 36 | 37 | 输出样例1: 38 | 39 | 4 40 | 41 | 样例1解释: 42 | 43 | ① 若K=4:前2周显然全部做完 => 第3周5题做了4道,还剩1道 => 第4周期中考试,复习不做题,累计1+6=7道题没做 => 第5周做题前累计可做7+2=9道,做了4道,还剩5道 => 第6周做题前累计可做5+1=6道,做了4道,还剩2道 => 第7周做题前所有作业还剩2道,可全部做完 => 第8周期末考试,复习不做题 => 学期结束后做完所有作业,满足条件 44 | 45 | ② 若K=3:第一周刚好做完 => 第2周4题做了3道,还剩1道 => 第3周做题前累计可做1+5=6道,做了3道,还剩3道 => 第4周期中考试,复习不做题,累计3+6=9道题没做 => 第5周做题前累计可做9+2=11道,做了3道,还剩8道 => 第6周做题前累计可做8+1=9道,做了3道,还剩6道 => 第7周做题前所有作业还剩6道,做了3道,还剩3道 => 第8周期末考试,复习不做题 => 学期结束后还有3道题没做,不满足条件 46 | 47 | 综合①②:K ≥ 4 => Kmin = 4 48 | 49 | 提示3: 50 | 51 | 1 ≤ N < W < 2N ≤ 10^6 52 | 53 | 数组homework中任意元素hi满足:1 ≤ hi ≤ N 54 | 55 | 提示4: 56 | 57 | 要求:算法的时间复杂度应该不超过O(NlogN) 58 | 59 | 语言: 60 | */ 61 | #include 62 | #include "stdio.h" 63 | using namespace std; 64 | int main() 65 | { 66 | int n, w; 67 | cin >> n >> w; 68 | 69 | system("pause"); 70 | return 0; 71 | } 72 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/2_20220424164217.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:做作业 4 | 5 | 题目描述: 6 | 7 | 假设算法课开学就布置好了一学期的作业,共N章课后习题,第i章的习题量为homework[i] (1 ≤ i ≤ N),要求在一学期之内(共W周)做完 8 | 9 | 现在你准备制定一个做作业的计划,规定自己每周做K道题,但是有些限制条件需要考虑: 10 | 11 | ① 由于老师1周只讲1章新的内容,因此第i周结束时最多能做完前i章的题; 12 | 13 | ② 由于期中考试周(第⌊W/2⌋周)和期末考试周(第W周)需要复习已做过的题,因此这两周不做新题; 14 | 15 | 为了每周末能按时赶去跳广场舞,你想尽量减小每周的题量K,但是又得保证在ddl前做完所有作业,请设计一个算法,帮助自己找到满足以上所有条件的K的最小值 16 | 17 | 提示1: 18 | 19 | 输入格式: 20 | 21 | 第一行依次为数组homework的大小N、一学期的周数W,二者以一个空格间隔,末尾无空格 22 | 23 | 第二行为数组homework,相邻元素之间以一个空格间隔,末尾无空格 24 | 25 | 输出格式: 26 | 27 | 一个正整数,即K的最小值 28 | 29 | 提示2: 30 | 31 | 输入样例1: 32 | 33 | 6 8 34 | 35 | 3 4 5 6 2 1 36 | 37 | 输出样例1: 38 | 39 | 4 40 | 41 | 样例1解释: 42 | 43 | ① 若K=4:前2周显然全部做完 => 第3周5题做了4道,还剩1道 => 第4周期中考试,复习不做题,累计1+6=7道题没做 => 第5周做题前累计可做7+2=9道,做了4道,还剩5道 => 第6周做题前累计可做5+1=6道,做了4道,还剩2道 => 第7周做题前所有作业还剩2道,可全部做完 => 第8周期末考试,复习不做题 => 学期结束后做完所有作业,满足条件 44 | 45 | ② 若K=3:第一周刚好做完 => 第2周4题做了3道,还剩1道 => 第3周做题前累计可做1+5=6道,做了3道,还剩3道 => 第4周期中考试,复习不做题,累计3+6=9道题没做 => 第5周做题前累计可做9+2=11道,做了3道,还剩8道 => 第6周做题前累计可做8+1=9道,做了3道,还剩6道 => 第7周做题前所有作业还剩6道,做了3道,还剩3道 => 第8周期末考试,复习不做题 => 学期结束后还有3道题没做,不满足条件 46 | 47 | 综合①②:K ≥ 4 => Kmin = 4 48 | 49 | 提示3: 50 | 51 | 1 ≤ N < W < 2N ≤ 10^6 52 | 53 | 数组homework中任意元素hi满足:1 ≤ hi ≤ N 54 | 55 | 提示4: 56 | 57 | 要求:算法的时间复杂度应该不超过O(NlogN) 58 | 59 | 语言: 60 | */ 61 | #include 62 | #include "stdio.h" 63 | using namespace std; 64 | int main() 65 | { 66 | int n, w; 67 | cin >> n >> w; 68 | int *hw = new int[w]; 69 | system("pause"); 70 | return 0; 71 | } 72 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/2_20220424164344.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:做作业 4 | 5 | 题目描述: 6 | 7 | 假设算法课开学就布置好了一学期的作业,共N章课后习题,第i章的习题量为homework[i] (1 ≤ i ≤ N),要求在一学期之内(共W周)做完 8 | 9 | 现在你准备制定一个做作业的计划,规定自己每周做K道题,但是有些限制条件需要考虑: 10 | 11 | ① 由于老师1周只讲1章新的内容,因此第i周结束时最多能做完前i章的题; 12 | 13 | ② 由于期中考试周(第⌊W/2⌋周)和期末考试周(第W周)需要复习已做过的题,因此这两周不做新题; 14 | 15 | 为了每周末能按时赶去跳广场舞,你想尽量减小每周的题量K,但是又得保证在ddl前做完所有作业,请设计一个算法,帮助自己找到满足以上所有条件的K的最小值 16 | 17 | 提示1: 18 | 19 | 输入格式: 20 | 21 | 第一行依次为数组homework的大小N、一学期的周数W,二者以一个空格间隔,末尾无空格 22 | 23 | 第二行为数组homework,相邻元素之间以一个空格间隔,末尾无空格 24 | 25 | 输出格式: 26 | 27 | 一个正整数,即K的最小值 28 | 29 | 提示2: 30 | 31 | 输入样例1: 32 | 33 | 6 8 34 | 35 | 3 4 5 6 2 1 36 | 37 | 输出样例1: 38 | 39 | 4 40 | 41 | 样例1解释: 42 | 43 | ① 若K=4:前2周显然全部做完 => 第3周5题做了4道,还剩1道 => 第4周期中考试,复习不做题,累计1+6=7道题没做 => 第5周做题前累计可做7+2=9道,做了4道,还剩5道 => 第6周做题前累计可做5+1=6道,做了4道,还剩2道 => 第7周做题前所有作业还剩2道,可全部做完 => 第8周期末考试,复习不做题 => 学期结束后做完所有作业,满足条件 44 | 45 | ② 若K=3:第一周刚好做完 => 第2周4题做了3道,还剩1道 => 第3周做题前累计可做1+5=6道,做了3道,还剩3道 => 第4周期中考试,复习不做题,累计3+6=9道题没做 => 第5周做题前累计可做9+2=11道,做了3道,还剩8道 => 第6周做题前累计可做8+1=9道,做了3道,还剩6道 => 第7周做题前所有作业还剩6道,做了3道,还剩3道 => 第8周期末考试,复习不做题 => 学期结束后还有3道题没做,不满足条件 46 | 47 | 综合①②:K ≥ 4 => Kmin = 4 48 | 49 | 提示3: 50 | 51 | 1 ≤ N < W < 2N ≤ 10^6 52 | 53 | 数组homework中任意元素hi满足:1 ≤ hi ≤ N 54 | 55 | 提示4: 56 | 57 | 要求:算法的时间复杂度应该不超过O(NlogN) 58 | 59 | 语言: 60 | */ 61 | #include 62 | #include "stdio.h" 63 | using namespace std; 64 | int main() 65 | { 66 | int n, w; 67 | cin >> n >> w; 68 | int *hw = new int[w]; 69 | 70 | system("pause"); 71 | return 0; 72 | } 73 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.history/2_20220428150224.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:做作业 4 | 5 | 题目描述: 6 | 7 | 假设算法课开学就布置好了一学期的作业,共N章课后习题,第i章的习题量为homework[i] (1 ≤ i ≤ N),要求在一学期之内(共W周)做完 8 | 9 | 现在你准备制定一个做作业的计划,规定自己每周做K道题,但是有些限制条件需要考虑: 10 | 11 | ① 由于老师1周只讲1章新的内容,因此第i周结束时最多能做完前i章的题; 12 | 13 | ② 由于期中考试周(第⌊W/2⌋周)和期末考试周(第W周)需要复习已做过的题,因此这两周不做新题; 14 | 15 | 为了每周末能按时赶去跳广场舞,你想尽量减小每周的题量K,但是又得保证在ddl前做完所有作业,请设计一个算法,帮助自己找到满足以上所有条件的K的最小值 16 | 17 | 提示1: 18 | 19 | 输入格式: 20 | 21 | 第一行依次为数组homework的大小N、一学期的周数W,二者以一个空格间隔,末尾无空格 22 | 23 | 第二行为数组homework,相邻元素之间以一个空格间隔,末尾无空格 24 | 25 | 输出格式: 26 | 27 | 一个正整数,即K的最小值 28 | 29 | 提示2: 30 | 31 | 输入样例1: 32 | 33 | 6 8 34 | 35 | 3 4 5 6 2 1 36 | 37 | 输出样例1: 38 | 39 | 4 40 | 41 | 样例1解释: 42 | 43 | ① 若K=4:前2周显然全部做完 => 第3周5题做了4道,还剩1道 => 第4周期中考试,复习不做题,累计1+6=7道题没做 => 第5周做题前累计可做7+2=9道,做了4道,还剩5道 => 第6周做题前累计可做5+1=6道,做了4道,还剩2道 => 第7周做题前所有作业还剩2道,可全部做完 => 第8周期末考试,复习不做题 => 学期结束后做完所有作业,满足条件 44 | 45 | ② 若K=3:第一周刚好做完 => 第2周4题做了3道,还剩1道 => 第3周做题前累计可做1+5=6道,做了3道,还剩3道 => 第4周期中考试,复习不做题,累计3+6=9道题没做 => 第5周做题前累计可做9+2=11道,做了3道,还剩8道 => 第6周做题前累计可做8+1=9道,做了3道,还剩6道 => 第7周做题前所有作业还剩6道,做了3道,还剩3道 => 第8周期末考试,复习不做题 => 学期结束后还有3道题没做,不满足条件 46 | 47 | 综合①②:K ≥ 4 => Kmin = 4 48 | 49 | 提示3: 50 | 51 | 1 ≤ N < W < 2N ≤ 10^6 52 | 53 | 数组homework中任意元素hi满足:1 ≤ hi ≤ N 54 | 55 | 提示4: 56 | 57 | 要求:算法的时间复杂度应该不超过O(NlogN) 58 | 59 | 语言: 60 | */ 61 | #include 62 | #include "stdio.h" 63 | using namespace std; 64 | int main() 65 | { 66 | int n, w; 67 | cin >> n >> w; 68 | int *hw = new int[w]; 69 | 70 | system("pause"); 71 | return 0; 72 | } 73 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.vscode/10.txt: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | using namespace std; 7 | int main() 8 | { 9 | 10 | system("pause"); 11 | return 0; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.vscode/edit.txt: -------------------------------------------------------------------------------- 1 | 2021暑期活动纪录片 -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "g++.exe - 生成和调试活动文件", 9 | "type": "cppdbg", 10 | "request": "launch", 11 | "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", 12 | "args": [], 13 | "stopAtEntry": false, 14 | "cwd": "D:\\mingw64\\bin\\", 15 | "environment": [], 16 | "externalConsole": true, 17 | "MIMode": "gdb", 18 | "miDebuggerPath": "D:\\mingw64\\bin\\gdb.exe", 19 | "setupCommands": [ 20 | { 21 | "description": "为 gdb 启用整齐打印", 22 | "text": "-enable-pretty-printing", 23 | "ignoreFailures": true 24 | } 25 | ], 26 | "preLaunchTask": "C/C++: g++.exe build active file" 27 | } 28 | ] 29 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.vscode/makefile: -------------------------------------------------------------------------------- 1 | obj=main.o 2 | target = main 3 | CC = g++ 4 | 5 | $(target) : $(obj) 6 | 7 | $(CC) $(obj) -o $(target) 8 | 9 | %.o :%.cpp 10 | $(CC) $< -c -o $@ -g 11 | 12 | clean: 13 | rm *.o main -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "iostream": "cpp", 4 | "xstring": "cpp", 5 | "string": "cpp", 6 | "xutility": "cpp", 7 | "atomic": "cpp", 8 | "bit": "cpp", 9 | "cctype": "cpp", 10 | "clocale": "cpp", 11 | "cmath": "cpp", 12 | "compare": "cpp", 13 | "concepts": "cpp", 14 | "cstddef": "cpp", 15 | "cstdint": "cpp", 16 | "cstdio": "cpp", 17 | "cstdlib": "cpp", 18 | "cstring": "cpp", 19 | "ctime": "cpp", 20 | "cwchar": "cpp", 21 | "exception": "cpp", 22 | "initializer_list": "cpp", 23 | "ios": "cpp", 24 | "iosfwd": "cpp", 25 | "istream": "cpp", 26 | "iterator": "cpp", 27 | "limits": "cpp", 28 | "memory": "cpp", 29 | "new": "cpp", 30 | "ostream": "cpp", 31 | "stdexcept": "cpp", 32 | "streambuf": "cpp", 33 | "system_error": "cpp", 34 | "tuple": "cpp", 35 | "type_traits": "cpp", 36 | "typeinfo": "cpp", 37 | "utility": "cpp", 38 | "xfacet": "cpp", 39 | "xiosbase": "cpp", 40 | "xlocale": "cpp", 41 | "xlocinfo": "cpp", 42 | "xlocnum": "cpp", 43 | "xmemory": "cpp", 44 | "xstddef": "cpp", 45 | "xtr1common": "cpp" 46 | } 47 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/3/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "tasks": [ 3 | { 4 | "type": "cppbuild", 5 | "label": "C/C++: g++.exe build active file", 6 | "command": "D:\\mingw64\\bin\\g++.exe", 7 | "args": [ 8 | "-g", 9 | "${file}", 10 | "-o", 11 | "${fileDirname}\\${fileBasenameNoExtension}.exe", 12 | "-std=c++17" 13 | ], 14 | "options": { 15 | "cwd": "D:\\mingw64\\bin" 16 | }, 17 | "problemMatcher": [ 18 | "$gcc" 19 | ], 20 | "group": { 21 | "kind": "build", 22 | "isDefault": true 23 | }, 24 | "detail": "Task generated by Debugger." 25 | } 26 | ], 27 | "version": "2.0.0" 28 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/3/1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/3/1.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/3/2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/3/2.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/4/.vscode/10.txt: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | using namespace std; 7 | int main() 8 | { 9 | 10 | system("pause"); 11 | return 0; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /Algorithm算法/Code/4/.vscode/edit.txt: -------------------------------------------------------------------------------- 1 | 2021暑期活动纪录片 -------------------------------------------------------------------------------- /Algorithm算法/Code/4/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "g++.exe - 生成和调试活动文件", 9 | "type": "cppdbg", 10 | "request": "launch", 11 | "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", 12 | "args": [], 13 | "stopAtEntry": false, 14 | "cwd": "D:\\mingw64\\bin\\", 15 | "environment": [], 16 | "externalConsole": true, 17 | "MIMode": "gdb", 18 | "miDebuggerPath": "D:\\mingw64\\bin\\gdb.exe", 19 | "setupCommands": [ 20 | { 21 | "description": "为 gdb 启用整齐打印", 22 | "text": "-enable-pretty-printing", 23 | "ignoreFailures": true 24 | } 25 | ], 26 | "preLaunchTask": "C/C++: g++.exe build active file" 27 | } 28 | ] 29 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/4/.vscode/makefile: -------------------------------------------------------------------------------- 1 | obj=main.o 2 | target = main 3 | CC = g++ 4 | 5 | $(target) : $(obj) 6 | 7 | $(CC) $(obj) -o $(target) 8 | 9 | %.o :%.cpp 10 | $(CC) $< -c -o $@ -g 11 | 12 | clean: 13 | rm *.o main -------------------------------------------------------------------------------- /Algorithm算法/Code/4/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "iostream": "cpp", 4 | "xstring": "cpp", 5 | "string": "cpp", 6 | "xutility": "cpp", 7 | "list": "cpp", 8 | "memory": "cpp", 9 | "vector": "cpp" 10 | } 11 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/4/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "tasks": [ 3 | { 4 | "type": "cppbuild", 5 | "label": "C/C++: g++.exe build active file", 6 | "command": "D:\\mingw64\\bin\\g++.exe", 7 | "args": [ 8 | "-g", 9 | "${file}", 10 | "-o", 11 | "${fileDirname}\\${fileBasenameNoExtension}.exe", 12 | "-std=c++17" 13 | ], 14 | "options": { 15 | "cwd": "D:\\mingw64\\bin" 16 | }, 17 | "problemMatcher": [ 18 | "$gcc" 19 | ], 20 | "group": { 21 | "kind": "build", 22 | "isDefault": true 23 | }, 24 | "detail": "Task generated by Debugger." 25 | } 26 | ], 27 | "version": "2.0.0" 28 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/4/1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/4/1.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/4/2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/4/2.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/4/解魔方-帮助文档 (c++版).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/4/解魔方-帮助文档 (c++版).pdf -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/1.1_20220527095220.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/5/.history/1.1_20220527095220.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/1.2_20220527132656.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/5/.history/1.2_20220527132656.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/1.2_20220527132658.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/5/.history/1.2_20220527132658.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/1.2_20220527132715.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | using namespace std; 7 | int main() 8 | { 9 | 10 | system("pause"); 11 | return 0; 12 | } 13 | int main() 14 | { 15 | int ans0, ans1; 16 | bool *ans = new bool[k + 1]; 17 | int count = 0; 18 | cin >> n >> m >> k; 19 | for (int i = 0; i < m; i++) 20 | { 21 | int u, v, w; 22 | cin >> u >> v >> w; 23 | g[u][v] = g[v][u] = w; 24 | } 25 | ans0 = primMST(g); 26 | // ans1 = ans0; 27 | for (int i = 0; i < k; i++) 28 | { 29 | int u, v, w; 30 | cin >> u >> v >> w; 31 | ans[i] = update(g0, u, v, w); 32 | } 33 | ans1 = primMST(g0); 34 | cout << ans0 << endl; 35 | for (int i = 0; i < k; i++) 36 | { 37 | if (ans[i]) 38 | cout << 'Y' << endl; 39 | else 40 | cout << 'N' << endl; 41 | } 42 | cout << ans1 << endl; 43 | 44 | return 0; 45 | } 46 | -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/1.2_20220527132719.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | using namespace std; 7 | 8 | int main() 9 | { 10 | int ans0, ans1; 11 | bool *ans = new bool[k + 1]; 12 | int count = 0; 13 | cin >> n >> m >> k; 14 | for (int i = 0; i < m; i++) 15 | { 16 | int u, v, w; 17 | cin >> u >> v >> w; 18 | g[u][v] = g[v][u] = w; 19 | } 20 | ans0 = primMST(g); 21 | // ans1 = ans0; 22 | for (int i = 0; i < k; i++) 23 | { 24 | int u, v, w; 25 | cin >> u >> v >> w; 26 | ans[i] = update(g0, u, v, w); 27 | } 28 | ans1 = primMST(g0); 29 | cout << ans0 << endl; 30 | for (int i = 0; i < k; i++) 31 | { 32 | if (ans[i]) 33 | cout << 'Y' << endl; 34 | else 35 | cout << 'N' << endl; 36 | } 37 | cout << ans1 << endl; 38 | 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/1.2_20220527132750.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | using namespace std; 7 | 8 | #define V 500 9 | #define INT_MAX 2147483647 10 | int n, m, k; 11 | 12 | int main() 13 | { 14 | int ans0, ans1; 15 | bool *ans = new bool[k + 1]; 16 | int count = 0; 17 | cin >> n >> m >> k; 18 | for (int i = 0; i < m; i++) 19 | { 20 | int u, v, w; 21 | cin >> u >> v >> w; 22 | g[u][v] = g[v][u] = w; 23 | } 24 | ans0 = primMST(g); 25 | // ans1 = ans0; 26 | for (int i = 0; i < k; i++) 27 | { 28 | int u, v, w; 29 | cin >> u >> v >> w; 30 | ans[i] = update(g0, u, v, w); 31 | } 32 | ans1 = primMST(g0); 33 | cout << ans0 << endl; 34 | for (int i = 0; i < k; i++) 35 | { 36 | if (ans[i]) 37 | cout << 'Y' << endl; 38 | else 39 | cout << 'N' << endl; 40 | } 41 | cout << ans1 << endl; 42 | 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/1.2_20220527133050.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | #include 7 | 8 | using namespace std; 9 | 10 | #define V 500 11 | #define INT_MAX 2147483647 12 | int n, m, k; 13 | 14 | struct node 15 | { 16 | int num; 17 | int w; 18 | }; 19 | 20 | class Graph 21 | { 22 | public: 23 | bool onpath[V]; 24 | list adj[V]; 25 | bool visited[V]; 26 | 27 | void addEdge(int u, int v, int w); 28 | 29 | int DFS_path(int v); 30 | }; 31 | 32 | void Graph::addEdge(int u, int v, int w) 33 | { 34 | adj[u].push_back(node(v, w)); // Add w to v’s list. 35 | } 36 | 37 | int main() 38 | { 39 | int ans0, ans1; 40 | bool *ans = new bool[k + 1]; 41 | int count = 0; 42 | cin >> n >> m >> k; 43 | for (int i = 0; i < m; i++) 44 | { 45 | int u, v, w; 46 | cin >> u >> v >> w; 47 | g[u][v] = g[v][u] = w; 48 | } 49 | ans0 = primMST(g); 50 | // ans1 = ans0; 51 | for (int i = 0; i < k; i++) 52 | { 53 | int u, v, w; 54 | cin >> u >> v >> w; 55 | ans[i] = update(g0, u, v, w); 56 | } 57 | ans1 = primMST(g0); 58 | cout << ans0 << endl; 59 | for (int i = 0; i < k; i++) 60 | { 61 | if (ans[i]) 62 | cout << 'Y' << endl; 63 | else 64 | cout << 'N' << endl; 65 | } 66 | cout << ans1 << endl; 67 | 68 | return 0; 69 | } 70 | -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/1.2_20220527133108.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | #include 7 | 8 | using namespace std; 9 | 10 | #define V 500 11 | #define INT_MAX 2147483647 12 | int n, m, k; 13 | 14 | struct node 15 | { 16 | int num; 17 | int w; 18 | }; 19 | 20 | class Graph 21 | { 22 | public: 23 | bool onpath[V]; 24 | list adj[V]; 25 | bool visited[V]; 26 | 27 | void addEdge(int u, int v, int w); 28 | 29 | int DFS_path(int v); 30 | }; 31 | 32 | void Graph::addEdge(int u, int v, int w) 33 | { 34 | node tmp ={v,w}; 35 | adj[u].push_back(tmp); // Add w to v’s list. 36 | } 37 | 38 | int main() 39 | { 40 | int ans0, ans1; 41 | bool *ans = new bool[k + 1]; 42 | int count = 0; 43 | cin >> n >> m >> k; 44 | for (int i = 0; i < m; i++) 45 | { 46 | int u, v, w; 47 | cin >> u >> v >> w; 48 | g[u][v] = g[v][u] = w; 49 | } 50 | ans0 = primMST(g); 51 | // ans1 = ans0; 52 | for (int i = 0; i < k; i++) 53 | { 54 | int u, v, w; 55 | cin >> u >> v >> w; 56 | ans[i] = update(g0, u, v, w); 57 | } 58 | ans1 = primMST(g0); 59 | cout << ans0 << endl; 60 | for (int i = 0; i < k; i++) 61 | { 62 | if (ans[i]) 63 | cout << 'Y' << endl; 64 | else 65 | cout << 'N' << endl; 66 | } 67 | cout << ans1 << endl; 68 | 69 | return 0; 70 | } 71 | -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/1.2_20220527133921.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | #include 7 | 8 | using namespace std; 9 | 10 | #define V 500 11 | #define INT_MAX 2147483647 12 | int n, m, k; 13 | bool flag[V]={0}; 14 | 15 | 16 | struct node 17 | { 18 | int num; 19 | int w; 20 | }; 21 | 22 | class Graph 23 | { 24 | public: 25 | bool onpath[V]; 26 | list adj[V]; 27 | bool visited[V]; 28 | 29 | void addEdge(int u, int v, int w); 30 | 31 | int DFS_path(int v); 32 | }; 33 | 34 | void Graph::addEdge(int u, int v, int w) 35 | { 36 | node tmp ={v,w}; 37 | adj[u].push_back(tmp); // Add w to v’s list. 38 | } 39 | 40 | 41 | int main() 42 | { 43 | int ans0, ans1; 44 | bool *ans = new bool[k + 1]; 45 | int count = 0; 46 | cin >> n >> m >> k; 47 | for (int i = 0; i < m; i++) 48 | { 49 | int u, v, w; 50 | cin >> u >> v >> w; 51 | g[u][v] = g[v][u] = w; 52 | } 53 | ans0 = primMST(g); 54 | // ans1 = ans0; 55 | for (int i = 0; i < k; i++) 56 | { 57 | int u, v, w; 58 | cin >> u >> v >> w; 59 | ans[i] = update(g0, u, v, w); 60 | } 61 | ans1 = primMST(g0); 62 | cout << ans0 << endl; 63 | for (int i = 0; i < k; i++) 64 | { 65 | if (ans[i]) 66 | cout << 'Y' << endl; 67 | else 68 | cout << 'N' << endl; 69 | } 70 | cout << ans1 << endl; 71 | 72 | return 0; 73 | } 74 | -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/1.2_20220527133951.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | #include 7 | 8 | using namespace std; 9 | 10 | #define V 500 11 | #define INT_MAX 2147483647 12 | int n, m, k; 13 | bool flag[V] = {0}; 14 | struct edge 15 | { 16 | int u, v; 17 | int w; 18 | }; 19 | 20 | struct node 21 | { 22 | int num; 23 | int w; 24 | }; 25 | 26 | class Graph 27 | { 28 | public: 29 | bool onpath[V]; 30 | list adj[V]; 31 | bool visited[V]; 32 | 33 | void addEdge(int u, int v, int w); 34 | 35 | int DFS_path(int v); 36 | }; 37 | 38 | void Graph::addEdge(int u, int v, int w) 39 | { 40 | node tmp = {v, w}; 41 | adj[u].push_back(tmp); // Add w to v’s list. 42 | } 43 | 44 | int main() 45 | { 46 | int ans0, ans1; 47 | bool *ans = new bool[k + 1]; 48 | int count = 0; 49 | cin >> n >> m >> k; 50 | for (int i = 0; i < m; i++) 51 | { 52 | int u, v, w; 53 | cin >> u >> v >> w; 54 | g[u][v] = g[v][u] = w; 55 | } 56 | ans0 = primMST(g); 57 | // ans1 = ans0; 58 | for (int i = 0; i < k; i++) 59 | { 60 | int u, v, w; 61 | cin >> u >> v >> w; 62 | ans[i] = update(g0, u, v, w); 63 | } 64 | ans1 = primMST(g0); 65 | cout << ans0 << endl; 66 | for (int i = 0; i < k; i++) 67 | { 68 | if (ans[i]) 69 | cout << 'Y' << endl; 70 | else 71 | cout << 'N' << endl; 72 | } 73 | cout << ans1 << endl; 74 | 75 | return 0; 76 | } 77 | -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/1.2_20220527133958.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | #include 7 | 8 | using namespace std; 9 | 10 | #define V 500 11 | #define INT_MAX 2147483647 12 | int n, m, k; 13 | bool flag[V] = {0}; 14 | struct edge 15 | { 16 | int u, v, w; 17 | }; 18 | 19 | struct node 20 | { 21 | int num; 22 | int w; 23 | }; 24 | 25 | class Graph 26 | { 27 | public: 28 | bool onpath[V]; 29 | list adj[V]; 30 | bool visited[V]; 31 | 32 | void addEdge(int u, int v, int w); 33 | 34 | int DFS_path(int v); 35 | }; 36 | 37 | void Graph::addEdge(int u, int v, int w) 38 | { 39 | node tmp = {v, w}; 40 | adj[u].push_back(tmp); // Add w to v’s list. 41 | } 42 | 43 | int main() 44 | { 45 | int ans0, ans1; 46 | bool *ans = new bool[k + 1]; 47 | int count = 0; 48 | cin >> n >> m >> k; 49 | for (int i = 0; i < m; i++) 50 | { 51 | int u, v, w; 52 | cin >> u >> v >> w; 53 | g[u][v] = g[v][u] = w; 54 | } 55 | ans0 = primMST(g); 56 | // ans1 = ans0; 57 | for (int i = 0; i < k; i++) 58 | { 59 | int u, v, w; 60 | cin >> u >> v >> w; 61 | ans[i] = update(g0, u, v, w); 62 | } 63 | ans1 = primMST(g0); 64 | cout << ans0 << endl; 65 | for (int i = 0; i < k; i++) 66 | { 67 | if (ans[i]) 68 | cout << 'Y' << endl; 69 | else 70 | cout << 'N' << endl; 71 | } 72 | cout << ans1 << endl; 73 | 74 | return 0; 75 | } 76 | -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/1.3_20220527150618.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/5/.history/1.3_20220527150618.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/1.4_20220527201830.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/5/.history/1.4_20220527201830.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/1.5_20220527214855.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/5/.history/1.5_20220527214855.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/1_20220524183810.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/5/.history/1_20220524183810.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/2_20220527162750.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/5/.history/2_20220527162750.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/2_20220527162757.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | using namespace std; 7 | int main() 8 | { 9 | 10 | system("pause"); 11 | return 0; 12 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/2_20220527163346.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | using namespace std; 7 | 8 | 9 | int main() 10 | { 11 | int n,m; 12 | cin >>n>>m; 13 | 14 | 15 | system("pause"); 16 | return 0; 17 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.history/2_20220527163531.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | using namespace std; 7 | 8 | 9 | int main() 10 | { 11 | int n,m; 12 | cin >>n>>m; 13 | 14 | 15 | system("pause"); 16 | return 0; 17 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.vscode/10.txt: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | using namespace std; 7 | int main() 8 | { 9 | 10 | system("pause"); 11 | return 0; 12 | } 13 | 14 | 5 5 4 15 | 16 | 0 1 4 17 | 18 | 0 2 3 19 | 20 | 0 3 4 21 | 22 | 0 4 5 23 | 24 | 2 4 6 25 | 26 | 27 | 2 3 2 28 | 29 | 2 4 7 30 | 31 | 0 4 4 32 | 33 | 1 3 4 34 | 35 | 36 | -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.vscode/edit.txt: -------------------------------------------------------------------------------- 1 | 2021暑期活动纪录片 -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "g++.exe - 生成和调试活动文件", 9 | "type": "cppdbg", 10 | "request": "launch", 11 | "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", 12 | "args": [], 13 | "stopAtEntry": false, 14 | "cwd": "D:\\mingw64\\bin\\", 15 | "environment": [], 16 | "externalConsole": true, 17 | "MIMode": "gdb", 18 | "miDebuggerPath": "D:\\mingw64\\bin\\gdb.exe", 19 | "setupCommands": [ 20 | { 21 | "description": "为 gdb 启用整齐打印", 22 | "text": "-enable-pretty-printing", 23 | "ignoreFailures": true 24 | } 25 | ], 26 | "preLaunchTask": "C/C++: g++.exe build active file" 27 | } 28 | ] 29 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.vscode/makefile: -------------------------------------------------------------------------------- 1 | obj=main.o 2 | target = main 3 | CC = g++ 4 | 5 | $(target) : $(obj) 6 | 7 | $(CC) $(obj) -o $(target) 8 | 9 | %.o :%.cpp 10 | $(CC) $< -c -o $@ -g 11 | 12 | clean: 13 | rm *.o main -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "iostream": "cpp", 4 | "xstring": "cpp", 5 | "string": "cpp", 6 | "xutility": "cpp", 7 | "list": "cpp", 8 | "vector": "cpp", 9 | "utility": "cpp", 10 | "deque": "cpp", 11 | "initializer_list": "cpp", 12 | "xtree": "cpp" 13 | } 14 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/5/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "tasks": [ 3 | { 4 | "type": "cppbuild", 5 | "label": "C/C++: g++.exe build active file", 6 | "command": "D:\\mingw64\\bin\\g++.exe", 7 | "args": [ 8 | "-g", 9 | "${file}", 10 | "-o", 11 | "${fileDirname}\\${fileBasenameNoExtension}.exe", 12 | "-std=c++17" 13 | ], 14 | "options": { 15 | "cwd": "D:\\mingw64\\bin" 16 | }, 17 | "problemMatcher": [ 18 | "$gcc" 19 | ], 20 | "group": { 21 | "kind": "build", 22 | "isDefault": true 23 | }, 24 | "detail": "Task generated by Debugger." 25 | } 26 | ], 27 | "version": "2.0.0" 28 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/5/1.1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/5/1.1.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/5/1.3.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/5/1.3.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/5/1.4.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/5/1.4.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/5/1.5.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/5/1.5.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/5/1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/5/1.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/5/2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/5/2.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/6/.vscode/10.txt: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | using namespace std; 7 | int main() 8 | { 9 | 10 | system("pause"); 11 | return 0; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /Algorithm算法/Code/6/.vscode/edit.txt: -------------------------------------------------------------------------------- 1 | 2021暑期活动纪录片 -------------------------------------------------------------------------------- /Algorithm算法/Code/6/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "g++.exe - 生成和调试活动文件", 9 | "type": "cppdbg", 10 | "request": "launch", 11 | "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", 12 | "args": [], 13 | "stopAtEntry": false, 14 | "cwd": "D:\\mingw64\\bin\\", 15 | "environment": [], 16 | "externalConsole": true, 17 | "MIMode": "gdb", 18 | "miDebuggerPath": "D:\\mingw64\\bin\\gdb.exe", 19 | "setupCommands": [ 20 | { 21 | "description": "为 gdb 启用整齐打印", 22 | "text": "-enable-pretty-printing", 23 | "ignoreFailures": true 24 | } 25 | ], 26 | "preLaunchTask": "C/C++: g++.exe build active file" 27 | } 28 | ] 29 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/6/.vscode/makefile: -------------------------------------------------------------------------------- 1 | obj=main.o 2 | target = main 3 | CC = g++ 4 | 5 | $(target) : $(obj) 6 | 7 | $(CC) $(obj) -o $(target) 8 | 9 | %.o :%.cpp 10 | $(CC) $< -c -o $@ -g 11 | 12 | clean: 13 | rm *.o main -------------------------------------------------------------------------------- /Algorithm算法/Code/6/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "iostream": "cpp", 4 | "xstring": "cpp", 5 | "string": "cpp", 6 | "xutility": "cpp" 7 | } 8 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/6/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "tasks": [ 3 | { 4 | "type": "cppbuild", 5 | "label": "C/C++: g++.exe build active file", 6 | "command": "D:\\mingw64\\bin\\g++.exe", 7 | "args": [ 8 | "-g", 9 | "${file}", 10 | "-o", 11 | "${fileDirname}\\${fileBasenameNoExtension}.exe", 12 | "-std=c++17" 13 | ], 14 | "options": { 15 | "cwd": "D:\\mingw64\\bin" 16 | }, 17 | "problemMatcher": [ 18 | "$gcc" 19 | ], 20 | "group": { 21 | "kind": "build", 22 | "isDefault": true 23 | }, 24 | "detail": "Task generated by Debugger." 25 | } 26 | ], 27 | "version": "2.0.0" 28 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/6/1.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:柴郡的天雷计划 4 | 5 | 题目描述: 6 | 7 | 柴郡为了庆祝周年庆,要帮指挥官偷别人的天雷图纸! 8 | 一共有n个地方的天雷图纸可以偷,第i个地方需要t[i]单位的石油,能偷到x[i]张天雷图纸,每个地方只能偷一次。 9 | 由于石油有限,只有m单位的石油,柴郡想知道用这些石油最多能偷到多少张天雷图纸? 10 | 11 | 12 | 13 | 输入格式 14 | 第一行两个整数,n和m,如题目所述。 15 | 接下来n行,每行两个整数t[i]和x[i],如题目所述。 16 | 17 | 输出格式 18 | 一个整数,表示最多能偷取的天雷图纸。 19 | 20 | 样例输入 21 | 3 70 22 | 71 100 23 | 69 1 24 | 1 2 25 | 26 | 样例输出 27 | 3 28 | 29 | 数据范围 30 | 1 <= n,m <= 2000 31 | 1 <= t[i] <= m 32 | 1 <= x[i] <= 100 33 | 34 | 35 | f[v]=max{f[v],f[v-w[i]]+v[i]} 36 | 37 | */ 38 | #include 39 | #include "stdio.h" 40 | using namespace std; 41 | int w[2048]; 42 | int val[2048]; 43 | int c[2048][2048]; 44 | int knapSack(int n, int m) // i 物品数目 j 容量 45 | { 46 | for (int i = 1; i < n; i++) 47 | { 48 | for (int j = 0; j < m; j++) 49 | { 50 | if (j == 0) 51 | c[i][j] = 0; 52 | else 53 | { 54 | if (j >= w[i-1]) 55 | c[i][j] = max(c[i - 1][j], c[i - 1][j - w[i-1]] + val[i-1]); 56 | else 57 | c[i][j] = c[i - 1][j]; 58 | } 59 | } 60 | } 61 | } 62 | 63 | // Driver code 64 | int main() 65 | { 66 | int n, m; 67 | cin >> n >> m; 68 | for (int i = 0; i < n; i++) 69 | { 70 | cin >> w[i] >> val[i]; 71 | } 72 | 73 | knapSack(n+1, m+1); 74 | cout << c[n][m]; 75 | 76 | system("pause"); 77 | return 0; 78 | } 79 | -------------------------------------------------------------------------------- /Algorithm算法/Code/6/1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/6/1.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/6/2.0.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/6/2.0.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/6/2.1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/6/2.1.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/6/2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/6/2.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/1.1_20220605174531.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/7/.history/1.1_20220605174531.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/1.2_20220605175727.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/7/.history/1.2_20220605175727.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/1_20220605104520.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/7/.history/1_20220605104520.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/1_20220605104528.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | using namespace std; 7 | int main() 8 | { 9 | 10 | system("pause"); 11 | return 0; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/1_20220605104542.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:扑克游戏I 4 | 5 | 题目描述: 6 | 7 | 一个月黑风高的夜,有两个高智商犯罪集团,分别称X党和Y党,合伙抢劫了一家赌场,但是在分赃时却出现了分歧,X党老大提议利用赌场里随处可见的扑克牌,和Y党老大玩一局游戏,以决定分赃的比例。 8 | 9 | 提示0: 10 | 11 | 游戏规则如下: 12 | 13 | ① 将赌场里的除了大小王的扑克牌收集起来,随机打乱,明牌摊开在桌子上,排成一行牌组 14 | 15 | ② X党老大先手,每轮两党老大轮流从牌组的左端或右端连续抽取任意非零数量的牌,直到牌全部抽完为止 16 | 17 | ③ 最后计算X党老大和Y党老大所抽牌的总分之差D,若D大于0,则X党多拿|D|万元;若D小于0,则Y党多拿|D|万元;若D等于0,则两党各分一半 18 | 19 | ④ 具体的计分规则如下: 20 | 21 | 1)红桃(记作'r')和方块牌(记作’s‘)得分为正,黑桃(记作'b')和梅花牌(记作'p')得分为负 22 | 23 | 2)对于3~10,牌所得分的绝对值等于其牌面的大小 24 | 25 | 3)对于JQKA2,牌所得分的绝对值依次为11~15 26 | 27 | ⑤ 假设两党老大都足够聪明 28 | 29 | 提示1: 30 | 31 | 输入格式: 32 | 33 | 第一行为牌组的大小N 34 | 35 | 第二行为牌面字符串nstr,其中nstr[i]表示从左往右数的第i+1张牌的牌面字符,10用'0'表示 (0 ≤ i ≤ N-1) 36 | 37 | 第三行为花色字符串cstr,其中cstr[i]表示从左往右数的第i+1张牌的花色字符 (0 ≤ i ≤ N-1) 38 | 39 | 输出格式: 40 | 41 | 一个整数,即X、Y党老大所抽牌的总分之差D 42 | 43 | 提示2: 44 | 45 | 输入样例1: 46 | 47 | 4 48 | 49 | JQ3A 50 | 51 | rbsp 52 | 53 | 输出样例1: 54 | 55 | 16 56 | 57 | 样例1解释: 58 | 59 | 每张牌的得分依次为11 -12 3 -14,X党老大先手会从左端选3张,得分11-12+3 = 2,Y党老大后手只能选最后1张,得分-14,D = 2 - (-14) = 16; 60 | 61 | 如果X党老大只从左端选1张,得分虽然为11更高,但是Y党老大会选择2、3张,将-14留给X党老大;故最终X党老大得分11-14 = -3,Y党老大得分-12+3 = -9,D = -3 - (-9) = 6,虽然X党也能赢但并非最优方案; 62 | 63 | 提示3: 64 | 65 | 1 ≤ N ≤ 104 66 | 67 | |D| ≤ 106 68 | 69 | 提示4: 70 | 71 | 要求:算法时间复杂度不超过O(N2) 72 | */ 73 | #include 74 | #include "stdio.h" 75 | using namespace std; 76 | int main() 77 | { 78 | 79 | system("pause"); 80 | return 0; 81 | } 82 | 83 | 84 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/1_20220605105227.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 题目:扑克游戏I 4 | 5 | 题目描述: 6 | 7 | 一个月黑风高的夜,有两个高智商犯罪集团,分别称X党和Y党,合伙抢劫了一家赌场,但是在分赃时却出现了分歧,X党老大提议利用赌场里随处可见的扑克牌,和Y党老大玩一局游戏,以决定分赃的比例。 8 | 9 | 提示0: 10 | 11 | 游戏规则如下: 12 | 13 | ① 将赌场里的除了大小王的扑克牌收集起来,随机打乱,明牌摊开在桌子上,排成一行牌组 14 | 15 | ② X党老大先手,每轮两党老大轮流从牌组的左端或右端连续抽取任意非零数量的牌,直到牌全部抽完为止 16 | 17 | ③ 最后计算X党老大和Y党老大所抽牌的总分之差D,若D大于0,则X党多拿|D|万元;若D小于0,则Y党多拿|D|万元;若D等于0,则两党各分一半 18 | 19 | ④ 具体的计分规则如下: 20 | 21 | 1)红桃(记作'r')和方块牌(记作’s‘)得分为正,黑桃(记作'b')和梅花牌(记作'p')得分为负 22 | 23 | 2)对于3~10,牌所得分的绝对值等于其牌面的大小 24 | 25 | 3)对于JQKA2,牌所得分的绝对值依次为11~15 26 | 27 | ⑤ 假设两党老大都足够聪明 28 | 29 | 提示1: 30 | 31 | 输入格式: 32 | 33 | 第一行为牌组的大小N 34 | 35 | 第二行为牌面字符串nstr,其中nstr[i]表示从左往右数的第i+1张牌的牌面字符,10用'0'表示 (0 ≤ i ≤ N-1) 36 | 37 | 第三行为花色字符串cstr,其中cstr[i]表示从左往右数的第i+1张牌的花色字符 (0 ≤ i ≤ N-1) 38 | 39 | 输出格式: 40 | 41 | 一个整数,即X、Y党老大所抽牌的总分之差D 42 | 43 | 提示2: 44 | 45 | 输入样例1: 46 | 47 | 4 48 | 49 | JQ3A 50 | 51 | rbsp 52 | 53 | 输出样例1: 54 | 55 | 16 56 | 57 | 样例1解释: 58 | 59 | 每张牌的得分依次为11 -12 3 -14,X党老大先手会从左端选3张,得分11-12+3 = 2,Y党老大后手只能选最后1张,得分-14,D = 2 - (-14) = 16; 60 | 61 | 如果X党老大只从左端选1张,得分虽然为11更高,但是Y党老大会选择2、3张,将-14留给X党老大;故最终X党老大得分11-14 = -3,Y党老大得分-12+3 = -9,D = -3 - (-9) = 6,虽然X党也能赢但并非最优方案; 62 | 63 | 提示3: 64 | 65 | 1 ≤ N ≤ 104 66 | 67 | |D| ≤ 106 68 | 69 | 提示4: 70 | 71 | 要求:算法时间复杂度不超过O(N2) 72 | */ 73 | #include 74 | #include "stdio.h" 75 | using namespace std; 76 | int n; 77 | int main() 78 | { 79 | cin >> n; 80 | system("pause"); 81 | return 0; 82 | } 83 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204137.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/7/.history/2.1_20220605204137.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204146.cpp: -------------------------------------------------------------------------------- 1 | int superEggDrop(int k, int n) 2 | { 3 | 4 | vector> dp(k, vector(n + 1, INT_MAX)); 5 | //动态规划边界条件 6 | //楼层=0 7 | for (int i = 0; i < k; ++i) 8 | dp[i][0] = 0; 9 | //只有一个蛋 10 | for (int j = 1; j <= n; ++j) 11 | dp[0][j] = j; 12 | for (int i = 1; i < k; ++i) //循环鸡蛋 1个蛋已经考虑过了 从2个鸡蛋(k==1)开始循环 13 | for (int j = 1; j <= n; ++j) // n层楼(总楼层) 14 | { 15 | int left = 1, right = j; 16 | int tmp = 0; //操作次数 17 | while (left <= right) 18 | { 19 | int mid = left + (right - left) / 2; 20 | int t1 = dp[i - 1][mid - 1]; //鸡蛋碎了 随着mid递增 21 | int t2 = dp[i][j - mid]; //鸡蛋没碎 随着mid递减 22 | // j-mid一定小于j所以 查找的t2一定已经计算过 23 | tmp = 1 + max(t1, t2); 24 | dp[i][j] = min(dp[i][j], tmp); 25 | if (t1 > t2) 26 | { 27 | //这里取大的保证最糟糕情况 28 | right = mid - 1; 29 | } 30 | else if (t1 < t2) 31 | { 32 | left = mid + 1; 33 | } 34 | else 35 | { 36 | break; 37 | } 38 | } 39 | } 40 | return dp.back().back(); 41 | } 42 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204208.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | 7 | 8 | int main() 9 | { 10 | cin >> nx >> kx >> ny >> ky; 11 | int fx = dp(ky, nx); 12 | int fy = dp(kx, ny); 13 | cout << min(fx, fy); 14 | 15 | system("pause"); 16 | return 0; 17 | } 18 | 19 | int superEggDrop(int k, int n) 20 | { 21 | 22 | vector> dp(k, vector(n + 1, INT_MAX)); 23 | //动态规划边界条件 24 | //楼层=0 25 | for (int i = 0; i < k; ++i) 26 | dp[i][0] = 0; 27 | //只有一个蛋 28 | for (int j = 1; j <= n; ++j) 29 | dp[0][j] = j; 30 | for (int i = 1; i < k; ++i) //循环鸡蛋 1个蛋已经考虑过了 从2个鸡蛋(k==1)开始循环 31 | for (int j = 1; j <= n; ++j) // n层楼(总楼层) 32 | { 33 | int left = 1, right = j; 34 | int tmp = 0; //操作次数 35 | while (left <= right) 36 | { 37 | int mid = left + (right - left) / 2; 38 | int t1 = dp[i - 1][mid - 1]; //鸡蛋碎了 随着mid递增 39 | int t2 = dp[i][j - mid]; //鸡蛋没碎 随着mid递减 40 | // j-mid一定小于j所以 查找的t2一定已经计算过 41 | tmp = 1 + max(t1, t2); 42 | dp[i][j] = min(dp[i][j], tmp); 43 | if (t1 > t2) 44 | { 45 | //这里取大的保证最糟糕情况 46 | right = mid - 1; 47 | } 48 | else if (t1 < t2) 49 | { 50 | left = mid + 1; 51 | } 52 | else 53 | { 54 | break; 55 | } 56 | } 57 | } 58 | return dp.back().back(); 59 | } 60 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204216.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | int superEggDrop(int k, int n) 7 | { 8 | 9 | vector> dp(k, vector(n + 1, INT_MAX)); 10 | //动态规划边界条件 11 | //楼层=0 12 | for (int i = 0; i < k; ++i) 13 | dp[i][0] = 0; 14 | //只有一个蛋 15 | for (int j = 1; j <= n; ++j) 16 | dp[0][j] = j; 17 | for (int i = 1; i < k; ++i) //循环鸡蛋 1个蛋已经考虑过了 从2个鸡蛋(k==1)开始循环 18 | for (int j = 1; j <= n; ++j) // n层楼(总楼层) 19 | { 20 | int left = 1, right = j; 21 | int tmp = 0; //操作次数 22 | while (left <= right) 23 | { 24 | int mid = left + (right - left) / 2; 25 | int t1 = dp[i - 1][mid - 1]; //鸡蛋碎了 随着mid递增 26 | int t2 = dp[i][j - mid]; //鸡蛋没碎 随着mid递减 27 | // j-mid一定小于j所以 查找的t2一定已经计算过 28 | tmp = 1 + max(t1, t2); 29 | dp[i][j] = min(dp[i][j], tmp); 30 | if (t1 > t2) 31 | { 32 | //这里取大的保证最糟糕情况 33 | right = mid - 1; 34 | } 35 | else if (t1 < t2) 36 | { 37 | left = mid + 1; 38 | } 39 | else 40 | { 41 | break; 42 | } 43 | } 44 | } 45 | return dp.back().back(); 46 | } 47 | 48 | int main() 49 | { 50 | cin >> nx >> kx >> ny >> ky; 51 | int fx = dp(ky, nx); 52 | int fy = dp(kx, ny); 53 | cout << min(fx, fy); 54 | 55 | system("pause"); 56 | return 0; 57 | } 58 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204221.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | int dp(int k, int n) 7 | { 8 | 9 | vector> dp(k, vector(n + 1, INT_MAX)); 10 | //动态规划边界条件 11 | //楼层=0 12 | for (int i = 0; i < k; ++i) 13 | dp[i][0] = 0; 14 | //只有一个蛋 15 | for (int j = 1; j <= n; ++j) 16 | dp[0][j] = j; 17 | for (int i = 1; i < k; ++i) //循环鸡蛋 1个蛋已经考虑过了 从2个鸡蛋(k==1)开始循环 18 | for (int j = 1; j <= n; ++j) // n层楼(总楼层) 19 | { 20 | int left = 1, right = j; 21 | int tmp = 0; //操作次数 22 | while (left <= right) 23 | { 24 | int mid = left + (right - left) / 2; 25 | int t1 = dp[i - 1][mid - 1]; //鸡蛋碎了 随着mid递增 26 | int t2 = dp[i][j - mid]; //鸡蛋没碎 随着mid递减 27 | // j-mid一定小于j所以 查找的t2一定已经计算过 28 | tmp = 1 + max(t1, t2); 29 | dp[i][j] = min(dp[i][j], tmp); 30 | if (t1 > t2) 31 | { 32 | //这里取大的保证最糟糕情况 33 | right = mid - 1; 34 | } 35 | else if (t1 < t2) 36 | { 37 | left = mid + 1; 38 | } 39 | else 40 | { 41 | break; 42 | } 43 | } 44 | } 45 | return dp.back().back(); 46 | } 47 | 48 | int main() 49 | { 50 | cin >> nx >> kx >> ny >> ky; 51 | int fx = dp(ky, nx); 52 | int fy = dp(kx, ny); 53 | cout << min(fx, fy); 54 | 55 | system("pause"); 56 | return 0; 57 | } 58 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204259.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | int dp(int k, int n) 7 | { 8 | 9 | vector> c(k, vector(n + 1, INT_MAX)); 10 | //动态规划边界条件 11 | //楼层=0 12 | for (int i = 0; i < k; ++i) 13 | c[i][0] = 0; 14 | //只有一个蛋 15 | for (int j = 1; j <= n; ++j) 16 | c[0][j] = j; 17 | for (int i = 1; i < k; ++i) //循环鸡蛋 1个蛋已经考虑过了 从2个鸡蛋(k==1)开始循环 18 | for (int j = 1; j <= n; ++j) // n层楼(总楼层) 19 | { 20 | int left = 1, right = j; 21 | int tmp = 0; //操作次数 22 | while (left <= right) 23 | { 24 | int mid = left + (right - left) / 2; 25 | int t1 = c[i - 1][mid - 1]; //鸡蛋碎了 随着mid递增 26 | int t2 = c[i][j - mid]; //鸡蛋没碎 随着mid递减 27 | // j-mid一定小于j所以 查找的t2一定已经计算过 28 | tmp = 1 + max(t1, t2); 29 | c[i][j] = min(c[i][j], tmp); 30 | if (t1 > t2) 31 | { 32 | //这里取大的保证最糟糕情况 33 | right = mid - 1; 34 | } 35 | else if (t1 < t2) 36 | { 37 | left = mid + 1; 38 | } 39 | else 40 | { 41 | break; 42 | } 43 | } 44 | } 45 | return c.back().back(); 46 | } 47 | 48 | int main() 49 | { 50 | cin >> nx >> kx >> ny >> ky; 51 | int fx = dp(ky, nx); 52 | int fy = dp(kx, ny); 53 | cout << min(fx, fy); 54 | 55 | system("pause"); 56 | return 0; 57 | } 58 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204316.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | int dp(int k, int n) 7 | { 8 | 9 | vector> c(k, vector(n + 1, INT_MAX)); 10 | //动态规划边界条件 11 | //楼层=0 12 | for (int i = 0; i < k; ++i) 13 | c[i][0] = 0; 14 | //只有一个蛋 15 | for (int j = 1; j <= n; ++j) 16 | c[0][j] = j; 17 | for (int i = 1; i < k; ++i) //循环鸡蛋 1个蛋已经考虑过了 从2个鸡蛋(k==1)开始循环 18 | for (int j = 1; j <= n; ++j) // n层楼(总楼层) 19 | { 20 | int left = 1, right = j; 21 | int tmp = 0; //操作次数 22 | while (left <= right) 23 | { 24 | int mid = left + (right - left) / 2; 25 | int t1 = c[i - 1][mid - 1]; //鸡蛋碎了 随着mid递增 26 | int t2 = c[i][j - mid]; //鸡蛋没碎 随着mid递减 27 | // j-mid一定小于j所以 查找的t2一定已经计算过 28 | tmp = 1 + max(t1, t2); 29 | c[i][j] = min(c[i][j], tmp); 30 | if (t1 > t2) 31 | { 32 | //这里取大的保证最糟糕情况 33 | right = mid - 1; 34 | } 35 | else if (t1 < t2) 36 | { 37 | left = mid + 1; 38 | } 39 | else 40 | { 41 | break; 42 | } 43 | } 44 | } 45 | return c.back().back(); 46 | } 47 | 48 | int main() 49 | { 50 | cin >> nx >> kx >> ny >> ky; 51 | int fx = dp(ky, nx); 52 | int fy = dp(kx, ny); 53 | cout << min(fx, fy); 54 | 55 | system("pause"); 56 | return 0; 57 | } 58 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204400.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | int dp(int k, int n) 7 | { 8 | 9 | vector> c(k, vector(n + 1, INT_MAX)); 10 | //动态规划边界条件 11 | //楼层=0 12 | for (int i = 0; i < k; i++) 13 | c[i][0] = 0; 14 | //只有一个蛋 15 | for (int j = 1; j <= n; j++) 16 | c[0][j] = j; 17 | for (int i = 1; i < k; ++i) //循环鸡蛋 1个蛋已经考虑过了 从2个鸡蛋(k==1)开始循环 18 | for (int j = 1; j <= n; ++j) // n层楼(总楼层) 19 | { 20 | int left = 1, right = j; 21 | int tmp = 0; //操作次数 22 | while (left <= right) 23 | { 24 | int mid = left + (right - left) / 2; 25 | int t1 = c[i - 1][mid - 1]; //鸡蛋碎了 随着mid递增 26 | int t2 = c[i][j - mid]; //鸡蛋没碎 随着mid递减 27 | // j-mid一定小于j所以 查找的t2一定已经计算过 28 | tmp = 1 + max(t1, t2); 29 | c[i][j] = min(c[i][j], tmp); 30 | if (t1 > t2) 31 | { 32 | //这里取大的保证最糟糕情况 33 | right = mid - 1; 34 | } 35 | else if (t1 < t2) 36 | { 37 | left = mid + 1; 38 | } 39 | else 40 | { 41 | break; 42 | } 43 | } 44 | } 45 | return c.back().back(); 46 | } 47 | 48 | int main() 49 | { 50 | cin >> nx >> kx >> ny >> ky; 51 | int fx = dp(ky, nx); 52 | int fy = dp(kx, ny); 53 | cout << min(fx, fy); 54 | 55 | system("pause"); 56 | return 0; 57 | } 58 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204434.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | int dp(int k, int n) 7 | { 8 | 9 | vector> c(k, vector(n + 1, INT_MAX));//k egg n+1 floor 10 | //动态规划边界条件 11 | //楼层=0 12 | for (int i = 0; i < k; i++) 13 | c[i][0] = 0; 14 | //只有一个蛋 15 | for (int j = 1; j <= n; j++) 16 | c[0][j] = j; 17 | for (int i = 1; i < k; ++i) //循环鸡蛋 1个蛋已经考虑过了 从2个鸡蛋(k==1)开始循环 18 | for (int j = 1; j <= n; ++j) // n层楼(总楼层) 19 | { 20 | int left = 1, right = j; 21 | int tmp = 0; //操作次数 22 | while (left <= right) 23 | { 24 | int mid = left + (right - left) / 2; 25 | int t1 = c[i - 1][mid - 1]; //鸡蛋碎了 随着mid递增 26 | int t2 = c[i][j - mid]; //鸡蛋没碎 随着mid递减 27 | // j-mid一定小于j所以 查找的t2一定已经计算过 28 | tmp = 1 + max(t1, t2); 29 | c[i][j] = min(c[i][j], tmp); 30 | if (t1 > t2) 31 | { 32 | //这里取大的保证最糟糕情况 33 | right = mid - 1; 34 | } 35 | else if (t1 < t2) 36 | { 37 | left = mid + 1; 38 | } 39 | else 40 | { 41 | break; 42 | } 43 | } 44 | } 45 | return c.back().back(); 46 | } 47 | 48 | int main() 49 | { 50 | cin >> nx >> kx >> ny >> ky; 51 | int fx = dp(ky, nx); 52 | int fy = dp(kx, ny); 53 | cout << min(fx, fy); 54 | 55 | system("pause"); 56 | return 0; 57 | } 58 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204452.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | int dp(int k, int n) 7 | { 8 | 9 | vector> c(k, vector(n + 1, INT_MAX));//k egg n+1 floor 10 | 11 | for (int i = 0; i < k; i++)//zero floor 12 | c[i][0] = 0; 13 | for (int j = 1; j <= n; j++)// one egg 14 | c[0][j] = j; 15 | for (int i = 1; i < k; ++i) //循环鸡蛋 1个蛋已经考虑过了 从2个鸡蛋(k==1)开始循环 16 | for (int j = 1; j <= n; ++j) // n层楼(总楼层) 17 | { 18 | int left = 1, right = j; 19 | int tmp = 0; //操作次数 20 | while (left <= right) 21 | { 22 | int mid = left + (right - left) / 2; 23 | int t1 = c[i - 1][mid - 1]; //鸡蛋碎了 随着mid递增 24 | int t2 = c[i][j - mid]; //鸡蛋没碎 随着mid递减 25 | // j-mid一定小于j所以 查找的t2一定已经计算过 26 | tmp = 1 + max(t1, t2); 27 | c[i][j] = min(c[i][j], tmp); 28 | if (t1 > t2) 29 | { 30 | //这里取大的保证最糟糕情况 31 | right = mid - 1; 32 | } 33 | else if (t1 < t2) 34 | { 35 | left = mid + 1; 36 | } 37 | else 38 | { 39 | break; 40 | } 41 | } 42 | } 43 | return c.back().back(); 44 | } 45 | 46 | int main() 47 | { 48 | cin >> nx >> kx >> ny >> ky; 49 | int fx = dp(ky, nx); 50 | int fy = dp(kx, ny); 51 | cout << min(fx, fy); 52 | 53 | system("pause"); 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204514.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | int dp(int k, int n) 7 | { 8 | 9 | vector> c(k, vector(n + 1, INT_MAX));//k egg n+1 floor 10 | 11 | for (int i = 0; i < k; i++)//zero floor 12 | c[i][0] = 0; 13 | for (int j = 1; j <= n; j++)// one egg 14 | c[0][j] = j; 15 | for (int i = 1; i < k; i++) //egg 16 | for (int j = 1; j <= n; j++) // floor 17 | { 18 | int left = 1, right = j; 19 | int tmp = 0; //操作次数 20 | while (left <= right) 21 | { 22 | int mid = left + (right - left) / 2; 23 | int t1 = c[i - 1][mid - 1]; //鸡蛋碎了 随着mid递增 24 | int t2 = c[i][j - mid]; //鸡蛋没碎 随着mid递减 25 | // j-mid一定小于j所以 查找的t2一定已经计算过 26 | tmp = 1 + max(t1, t2); 27 | c[i][j] = min(c[i][j], tmp); 28 | if (t1 > t2) 29 | { 30 | //这里取大的保证最糟糕情况 31 | right = mid - 1; 32 | } 33 | else if (t1 < t2) 34 | { 35 | left = mid + 1; 36 | } 37 | else 38 | { 39 | break; 40 | } 41 | } 42 | } 43 | return c.back().back(); 44 | } 45 | 46 | int main() 47 | { 48 | cin >> nx >> kx >> ny >> ky; 49 | int fx = dp(ky, nx); 50 | int fy = dp(kx, ny); 51 | cout << min(fx, fy); 52 | 53 | system("pause"); 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204535.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | int dp(int k, int n) 7 | { 8 | 9 | vector> c(k, vector(n + 1, INT_MAX));//k egg n+1 floor 10 | 11 | for (int i = 0; i < k; i++)//zero floor 12 | c[i][0] = 0; 13 | for (int j = 1; j <= n; j++)// one egg 14 | c[0][j] = j; 15 | for (int i = 1; i < k; i++) //egg 16 | for (int j = 1; j <= n; j++) // floor 17 | { 18 | int low = 1, high = j; 19 | int tmp = 0; //操作次数 20 | while (low <= high) 21 | { 22 | int mid = low + (high - low) / 2; 23 | int t1 = c[i - 1][mid - 1]; //鸡蛋碎了 随着mid递增 24 | int t2 = c[i][j - mid]; //鸡蛋没碎 随着mid递减 25 | // j-mid一定小于j所以 查找的t2一定已经计算过 26 | tmp = 1 + max(t1, t2); 27 | c[i][j] = min(c[i][j], tmp); 28 | if (t1 > t2) 29 | { 30 | //这里取大的保证最糟糕情况 31 | high = mid - 1; 32 | } 33 | else if (t1 < t2) 34 | { 35 | low = mid + 1; 36 | } 37 | else 38 | { 39 | break; 40 | } 41 | } 42 | } 43 | return c.back().back(); 44 | } 45 | 46 | int main() 47 | { 48 | cin >> nx >> kx >> ny >> ky; 49 | int fx = dp(ky, nx); 50 | int fy = dp(kx, ny); 51 | cout << min(fx, fy); 52 | 53 | system("pause"); 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204652.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | int dp(int k, int n) 7 | { 8 | 9 | vector> c(k, vector(n + 1, INT_MAX));//k egg n+1 floor 10 | 11 | for (int i = 0; i < k; i++)//zero floor 12 | c[i][0] = 0; 13 | for (int j = 1; j <= n; j++)// one egg 14 | c[0][j] = j; 15 | for (int i = 1; i < k; i++) //egg 16 | for (int j = 1; j <= n; j++) // floor 17 | { 18 | int low = 1, high = j; 19 | int tmp = 0; //操作次数 20 | while (low <= high) 21 | { 22 | int mid = low + (high - low) / 2; 23 | int t1 = c[i - 1][mid - 1]; // broke, go down 24 | int t2 = c[i][j - mid]; //survive, floor higher 25 | // j-mid一定小于j所以 查找的t2一定已经计算过 26 | tmp = 1 + max(t1, t2); 27 | c[i][j] = min(c[i][j], tmp); 28 | if (t1 > t2) 29 | { 30 | //这里取大的保证最糟糕情况 31 | high = mid - 1; 32 | } 33 | else if (t1 < t2) 34 | { 35 | low = mid + 1; 36 | } 37 | else 38 | { 39 | break; 40 | } 41 | } 42 | } 43 | return c.back().back(); 44 | } 45 | 46 | int main() 47 | { 48 | cin >> nx >> kx >> ny >> ky; 49 | int fx = dp(ky, nx); 50 | int fy = dp(kx, ny); 51 | cout << min(fx, fy); 52 | 53 | system("pause"); 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204823.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | #define INT_MAX 2147483647; 7 | int dp(int k, int n) 8 | { 9 | 10 | vector> c(k, vector(n + 1, INT_MAX)); // k egg n+1 floor 11 | 12 | for (int i = 0; i < k; i++) // zero floor 13 | c[i][0] = 0; 14 | for (int j = 1; j <= n; j++) // one egg 15 | c[0][j] = j; 16 | for (int i = 1; i < k; i++) // egg 17 | for (int j = 1; j <= n; j++) // floor 18 | { 19 | int low = 1, high = j; 20 | int tmp = 0; //操作次数 21 | while (low <= high) 22 | { 23 | int mid = low + (high - low) / 2; 24 | int t1 = c[i - 1][mid - 1]; // broke, go down 25 | int t2 = c[i][j - mid]; // survive, floor higher 26 | tmp = 1 + max(t1, t2); 27 | c[i][j] = min(c[i][j], tmp); 28 | if (t1 > t2) 29 | { 30 | high = mid - 1; 31 | } 32 | else if (t1 < t2) 33 | { 34 | low = mid + 1; 35 | } 36 | else 37 | { 38 | break; 39 | } 40 | } 41 | } 42 | return c.back().back(); 43 | } 44 | 45 | int main() 46 | { 47 | cin >> nx >> kx >> ny >> ky; 48 | int fx = dp(ky, nx); 49 | int fy = dp(kx, ny); 50 | cout << min(fx, fy); 51 | 52 | system("pause"); 53 | return 0; 54 | } 55 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204915.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | #define INT_MAX 2147483647; 7 | int dp(int k, int n) 8 | { 9 | 10 | vector> c(k, vector(n + 1, INT_MAX); // k egg n+1 floor 11 | 12 | for (int i = 0; i < k; i++) // zero floor 13 | c[i][0] = 0; 14 | for (int j = 1; j <= n; j++) // one egg 15 | c[0][j] = j; 16 | for (int i = 1; i < k; i++) // egg 17 | for (int j = 1; j <= n; j++) // floor 18 | { 19 | int low = 1, high = j; 20 | int tmp = 0; //操作次数 21 | while (low <= high) 22 | { 23 | int mid = low + (high - low) / 2; 24 | int t1 = c[i - 1][mid - 1]; // broke, go down 25 | int t2 = c[i][j - mid]; // survive, floor higher 26 | tmp = 1 + max(t1, t2); 27 | c[i][j] = min(c[i][j], tmp); 28 | if (t1 > t2) 29 | { 30 | high = mid - 1; 31 | } 32 | else if (t1 < t2) 33 | { 34 | low = mid + 1; 35 | } 36 | else 37 | { 38 | break; 39 | } 40 | } 41 | } 42 | return c.back().back(); 43 | } 44 | 45 | int main() 46 | { 47 | cin >> nx >> kx >> ny >> ky; 48 | int fx = dp(ky, nx); 49 | int fy = dp(kx, ny); 50 | cout << min(fx, fy); 51 | 52 | system("pause"); 53 | return 0; 54 | } 55 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204917.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | #define INT_MAX 2147483647; 7 | int dp(int k, int n) 8 | { 9 | 10 | vector> c(k, vector(n + 1, INT_MAX); // k egg n+1 floor 11 | 12 | for (int i = 0; i < k; i++) // zero floor 13 | c[i][0] = 0; 14 | for (int j = 1; j <= n; j++) // one egg 15 | c[0][j] = j; 16 | for (int i = 1; i < k; i++) // egg 17 | for (int j = 1; j <= n; j++) // floor 18 | { 19 | int low = 1, high = j; 20 | int tmp = 0; //操作次数 21 | while (low <= high) 22 | { 23 | int mid = low + (high - low) / 2; 24 | int t1 = c[i - 1][mid - 1]; // broke, go down 25 | int t2 = c[i][j - mid]; // survive, floor higher 26 | tmp = 1 + max(t1, t2); 27 | c[i][j] = min(c[i][j], tmp); 28 | if (t1 > t2) 29 | { 30 | high = mid - 1; 31 | } 32 | else if (t1 < t2) 33 | { 34 | low = mid + 1; 35 | } 36 | else 37 | { 38 | break; 39 | } 40 | } 41 | } 42 | return c.back().back(); 43 | } 44 | 45 | int main() 46 | { 47 | cin >> nx >> kx >> ny >> ky; 48 | int fx = dp(ky, nx); 49 | int fy = dp(kx, ny); 50 | cout << min(fx, fy); 51 | 52 | system("pause"); 53 | return 0; 54 | } 55 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204925.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | #define INT_MAX 2147483647; 7 | int dp(int k, int n) 8 | { 9 | vector> c(k, vector(n + 1, INT_MAX)); // k egg n+1 floor 10 | 11 | for (int i = 0; i < k; i++) // zero floor 12 | c[i][0] = 0; 13 | for (int j = 1; j <= n; j++) // one egg 14 | c[0][j] = j; 15 | for (int i = 1; i < k; i++) // egg 16 | for (int j = 1; j <= n; j++) // floor 17 | { 18 | int low = 1, high = j; 19 | int tmp = 0; //操作次数 20 | while (low <= high) 21 | { 22 | int mid = low + (high - low) / 2; 23 | int t1 = c[i - 1][mid - 1]; // broke, go down 24 | int t2 = c[i][j - mid]; // survive, floor higher 25 | tmp = 1 + max(t1, t2); 26 | c[i][j] = min(c[i][j], tmp); 27 | if (t1 > t2) 28 | { 29 | high = mid - 1; 30 | } 31 | else if (t1 < t2) 32 | { 33 | low = mid + 1; 34 | } 35 | else 36 | { 37 | break; 38 | } 39 | } 40 | } 41 | return c.back().back(); 42 | } 43 | 44 | int main() 45 | { 46 | cin >> nx >> kx >> ny >> ky; 47 | int fx = dp(ky, nx); 48 | int fy = dp(kx, ny); 49 | cout << min(fx, fy); 50 | 51 | system("pause"); 52 | return 0; 53 | } 54 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204928.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | #define INT_MAX 2147483647; 7 | int dp(int k, int n) 8 | { 9 | vector> c(k, vector(n + 1, INT_MAX)); // k egg n+1 floor 10 | 11 | for (int i = 0; i < k; i++) // zero floor 12 | c[i][0] = 0; 13 | for (int j = 1; j <= n; j++) // one egg 14 | c[0][j] = j; 15 | for (int i = 1; i < k; i++) // egg 16 | for (int j = 1; j <= n; j++) // floor 17 | { 18 | int low = 1, high = j; 19 | int tmp = 0; //操作次数 20 | while (low <= high) 21 | { 22 | int mid = low + (high - low) / 2; 23 | int t1 = c[i - 1][mid - 1]; // broke, go down 24 | int t2 = c[i][j - mid]; // survive, floor higher 25 | tmp = 1 + max(t1, t2); 26 | c[i][j] = min(c[i][j], tmp); 27 | if (t1 > t2) 28 | { 29 | high = mid - 1; 30 | } 31 | else if (t1 < t2) 32 | { 33 | low = mid + 1; 34 | } 35 | else 36 | { 37 | break; 38 | } 39 | } 40 | } 41 | return c.back().back(); 42 | } 43 | 44 | int main() 45 | { 46 | cin >> nx >> kx >> ny >> ky; 47 | int fx = dp(ky, nx); 48 | int fy = dp(kx, ny); 49 | cout << min(fx, fy); 50 | 51 | system("pause"); 52 | return 0; 53 | } 54 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204948.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | #define INT_MAX 2147483647 7 | int dp(int k, int n) 8 | { 9 | vector> c(k, vector(n + 1, INT_MAX)); // k egg n+1 floor 10 | 11 | for (int i = 0; i < k; i++) // zero floor 12 | c[i][0] = 0; 13 | for (int j = 1; j <= n; j++) // one egg 14 | c[0][j] = j; 15 | for (int i = 1; i < k; i++) // egg 16 | for (int j = 1; j <= n; j++) // floor 17 | { 18 | int low = 1, high = j; 19 | int tmp = 0; //操作次数 20 | while (low <= high) 21 | { 22 | int mid = low + (high - low) / 2; 23 | int t1 = c[i - 1][mid - 1]; // broke, go down 24 | int t2 = c[i][j - mid]; // survive, floor higher 25 | tmp = 1 + max(t1, t2); 26 | c[i][j] = min(c[i][j], tmp); 27 | if (t1 > t2) 28 | { 29 | high = mid - 1; 30 | } 31 | else if (t1 < t2) 32 | { 33 | low = mid + 1; 34 | } 35 | else 36 | { 37 | break; 38 | } 39 | } 40 | } 41 | return c.back().back(); 42 | } 43 | 44 | int main() 45 | { 46 | cin >> nx >> kx >> ny >> ky; 47 | int fx = dp(ky, nx); 48 | int fy = dp(kx, ny); 49 | cout << min(fx, fy); 50 | 51 | system("pause"); 52 | return 0; 53 | } 54 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605204950.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | #define INT_MAX 2147483647 7 | int dp(int k, int n) 8 | { 9 | vector> c(k, vector(n + 1, INT_MAX)); // k egg n+1 floor 10 | 11 | for (int i = 0; i < k; i++) // zero floor 12 | c[i][0] = 0; 13 | for (int j = 1; j <= n; j++) // one egg 14 | c[0][j] = j; 15 | for (int i = 1; i < k; i++) // egg 16 | for (int j = 1; j <= n; j++) // floor 17 | { 18 | int low = 1, high = j; 19 | int tmp = 0; //操作次数 20 | while (low <= high) 21 | { 22 | int mid = low + (high - low) / 2; 23 | int t1 = c[i - 1][mid - 1]; // broke, go down 24 | int t2 = c[i][j - mid]; // survive, floor higher 25 | tmp = 1 + max(t1, t2); 26 | c[i][j] = min(c[i][j], tmp); 27 | if (t1 > t2) 28 | { 29 | high = mid - 1; 30 | } 31 | else if (t1 < t2) 32 | { 33 | low = mid + 1; 34 | } 35 | else 36 | { 37 | break; 38 | } 39 | } 40 | } 41 | return c.back().back(); 42 | } 43 | 44 | int main() 45 | { 46 | cin >> nx >> kx >> ny >> ky; 47 | int fx = dp(ky, nx); 48 | int fy = dp(kx, ny); 49 | cout << min(fx, fy); 50 | 51 | system("pause"); 52 | return 0; 53 | } 54 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605205033.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | #define INT_MAX 2147483647 7 | int dp(int k, int n) 8 | { 9 | vector> c(k, vector(n + 1, INT_MAX)); // k egg n+1 floor 10 | 11 | for (int i = 0; i < k; i++) // zero floor 12 | c[i][0] = 0; 13 | for (int j = 1; j <= n; j++) // one egg 14 | c[0][j] = j; 15 | for (int i = 1; i < k; i++) // egg 16 | for (int j = 1; j <= n; j++) // floor 17 | { 18 | int low = 1, high = j; 19 | int tmp = 0; //操作次数 20 | while (low <= high) 21 | { 22 | int mid = low + (high - low) / 2; 23 | int t1 = c[i - 1][mid - 1]; // broke, go down 24 | int t2 = c[i][j - mid]; // survive, floor higher 25 | tmp = 1 + max(t1, t2); 26 | c[i][j] = min(c[i][j], tmp); 27 | if (t1 > t2) 28 | { 29 | high = mid - 1; 30 | } 31 | else if (t1 < t2) 32 | { 33 | low = mid + 1; 34 | } 35 | else 36 | { 37 | break; 38 | } 39 | } 40 | } 41 | return c[k][n]; 42 | } 43 | 44 | int main() 45 | { 46 | cin >> nx >> kx >> ny >> ky; 47 | int fx = dp(ky, nx); 48 | int fy = dp(kx, ny); 49 | cout << min(fx, fy); 50 | 51 | system("pause"); 52 | return 0; 53 | } 54 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2.1_20220605205216.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | #define INT_MAX 2147483647 7 | int dp(int k, int n) 8 | { 9 | vector> c(k, vector(n + 1, INT_MAX)); // k egg n+1 floor 10 | 11 | for (int i = 0; i < k; i++) // zero floor 12 | c[i][0] = 0; 13 | for (int j = 1; j <= n; j++) // one egg 14 | c[0][j] = j; 15 | for (int i = 1; i < k; i++) // egg 16 | for (int j = 1; j <= n; j++) // floor 17 | { 18 | int low = 1, high = j; 19 | int tmp = 0; //操作次数 20 | while (low <= high) 21 | { 22 | int mid = low + (high - low) / 2; 23 | int t1 = c[i - 1][mid - 1]; // broke, go down 24 | int t2 = c[i][j - mid]; // survive, floor higher 25 | tmp = 1 + max(t1, t2); 26 | c[i][j] = min(c[i][j], tmp); 27 | if (t1 > t2) 28 | { 29 | high = mid - 1; 30 | } 31 | else if (t1 < t2) 32 | { 33 | low = mid + 1; 34 | } 35 | else 36 | { 37 | break; 38 | } 39 | } 40 | } 41 | return c[k-1][n]; 42 | } 43 | 44 | int main() 45 | { 46 | cin >> nx >> kx >> ny >> ky; 47 | int fx = dp(ky, nx); 48 | int fy = dp(kx, ny); 49 | cout << min(fx, fy); 50 | 51 | system("pause"); 52 | return 0; 53 | } 54 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605111548.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/7/.history/2_20220605111548.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605111558.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 5 | */ 6 | #include 7 | #include "stdio.h" 8 | using namespace std; 9 | int main() 10 | { 11 | 12 | system("pause"); 13 | return 0; 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605200919.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | int main() 19 | { 20 | 21 | system("pause"); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605200930.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | int main() 19 | { 20 | cin >> nx >> kx >> ny >> ky; 21 | system("pause"); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605201011.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | int dp(int k, int n) 19 | { 20 | if (memo.find(n * 100 + k) == memo.end()) 21 | { 22 | int ans; 23 | if (n == 0) 24 | { 25 | ans = 0; 26 | } 27 | else if (k == 1) 28 | { 29 | ans = n; 30 | } 31 | else 32 | { 33 | int lo = 1, hi = n; 34 | while (lo + 1 < hi) 35 | { 36 | int x = (lo + hi) / 2; 37 | int t1 = dp(k - 1, x - 1); 38 | int t2 = dp(k, n - x); 39 | 40 | if (t1 < t2) 41 | { 42 | lo = x; 43 | } 44 | else if (t1 > t2) 45 | { 46 | hi = x; 47 | } 48 | else 49 | { 50 | lo = hi = x; 51 | } 52 | } 53 | 54 | ans = 1 + min(max(dp(k - 1, lo - 1), dp(k, n - lo)), 55 | max(dp(k - 1, hi - 1), dp(k, n - hi))); 56 | } 57 | 58 | int main() 59 | { 60 | cin >> nx >> kx >> ny >> ky; 61 | 62 | system("pause"); 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605201034.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | int dp(int k, int n) 19 | { 20 | 21 | int ans; 22 | if (n == 0) 23 | { 24 | ans = 0; 25 | } 26 | else if (k == 1) 27 | { 28 | ans = n; 29 | } 30 | else 31 | { 32 | int lo = 1, hi = n; 33 | while (lo + 1 < hi) 34 | { 35 | int x = (lo + hi) / 2; 36 | int t1 = dp(k - 1, x - 1); 37 | int t2 = dp(k, n - x); 38 | 39 | if (t1 < t2) 40 | { 41 | lo = x; 42 | } 43 | else if (t1 > t2) 44 | { 45 | hi = x; 46 | } 47 | else 48 | { 49 | lo = hi = x; 50 | } 51 | } 52 | 53 | ans = 1 + min(max(dp(k - 1, lo - 1), dp(k, n - lo)), 54 | max(dp(k - 1, hi - 1), dp(k, n - hi))); 55 | 56 | int main() 57 | { 58 | cin >> nx >> kx >> ny >> ky; 59 | 60 | system("pause"); 61 | return 0; 62 | } 63 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605201043.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | int dp(int k, int n) 19 | { 20 | 21 | int ans; 22 | if (n == 0) 23 | { 24 | ans = 0; 25 | } 26 | else if (k == 1) 27 | { 28 | ans = n; 29 | } 30 | else 31 | { 32 | int lo = 1, hi = n; 33 | while (lo + 1 < hi) 34 | { 35 | int x = (lo + hi) / 2; 36 | int t1 = dp(k - 1, x - 1); 37 | int t2 = dp(k, n - x); 38 | 39 | if (t1 < t2) 40 | { 41 | lo = x; 42 | } 43 | else if (t1 > t2) 44 | { 45 | hi = x; 46 | } 47 | else 48 | { 49 | lo = hi = x; 50 | } 51 | } 52 | 53 | ans = 1 + min(max(dp(k - 1, lo - 1), dp(k, n - lo)), 54 | max(dp(k - 1, hi - 1), dp(k, n - hi))); 55 | } 56 | } 57 | 58 | int main() 59 | { 60 | cin >> nx >> kx >> ny >> ky; 61 | 62 | system("pause"); 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605201123.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | int dp(int k, int n) 19 | { 20 | 21 | int ans; 22 | if (n == 0) 23 | ans = 0; 24 | else if (k == 1) 25 | ans = n; 26 | 27 | else 28 | { 29 | int lo = 1, hi = n; 30 | while (lo + 1 < hi) 31 | { 32 | int x = (lo + hi) / 2; 33 | int t1 = dp(k - 1, x - 1); 34 | int t2 = dp(k, n - x); 35 | 36 | if (t1 < t2) 37 | { 38 | lo = x; 39 | } 40 | else if (t1 > t2) 41 | { 42 | hi = x; 43 | } 44 | else 45 | { 46 | lo = hi = x; 47 | } 48 | } 49 | 50 | ans = 1 + min(max(dp(k - 1, lo - 1), dp(k, n - lo)), 51 | max(dp(k - 1, hi - 1), dp(k, n - hi))); 52 | } 53 | } 54 | 55 | int main() 56 | { 57 | cin >> nx >> kx >> ny >> ky; 58 | 59 | system("pause"); 60 | return 0; 61 | } 62 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605201132.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | int dp(int k, int n) 19 | { 20 | 21 | int ans; 22 | if (n == 0) 23 | ans = 0; 24 | else if (k == 1) 25 | ans = n; 26 | else 27 | { 28 | int lo = 1, hi = n; 29 | while (lo + 1 < hi) 30 | { 31 | int x = (lo + hi) / 2; 32 | int t1 = dp(k - 1, x - 1); 33 | int t2 = dp(k, n - x); 34 | 35 | if (t1 < t2) 36 | { 37 | lo = x; 38 | } 39 | else if (t1 > t2) 40 | { 41 | hi = x; 42 | } 43 | else 44 | { 45 | lo = hi = x; 46 | } 47 | } 48 | 49 | ans = 1 + min(max(dp(k - 1, lo - 1), dp(k, n - lo)), 50 | max(dp(k - 1, hi - 1), dp(k, n - hi))); 51 | } 52 | return ans; 53 | } 54 | 55 | int main() 56 | { 57 | cin >> nx >> kx >> ny >> ky; 58 | 59 | system("pause"); 60 | return 0; 61 | } 62 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605201136.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | int dp(int k, int n) 19 | { 20 | 21 | int ans; 22 | if (n == 0) 23 | ans = 0; 24 | else if (k == 1) 25 | ans = n; 26 | else 27 | { 28 | int lo = 1, hi = n; 29 | while (lo + 1 < hi) 30 | { 31 | int x = (lo + hi) / 2; 32 | int t1 = dp(k - 1, x - 1); 33 | int t2 = dp(k, n - x); 34 | 35 | if (t1 < t2) 36 | { 37 | lo = x; 38 | } 39 | else if (t1 > t2) 40 | { 41 | hi = x; 42 | } 43 | else 44 | { 45 | lo = hi = x; 46 | } 47 | } 48 | 49 | ans = 1 + min(max(dp(k - 1, lo - 1), dp(k, n - lo)), 50 | max(dp(k - 1, hi - 1), dp(k, n - hi))); 51 | } 52 | return ans; 53 | } 54 | 55 | int main() 56 | { 57 | cin >> nx >> kx >> ny >> ky; 58 | 59 | 60 | system("pause"); 61 | return 0; 62 | } 63 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605201210.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | int dp(int k, int n) 19 | { 20 | 21 | int ans; 22 | if (n == 0) 23 | ans = 0; 24 | else if (k == 1) 25 | ans = n; 26 | else 27 | { 28 | int lo = 1, hi = n; 29 | while (lo + 1 < hi) 30 | { 31 | int x = (lo + hi) / 2; 32 | int t1 = dp(k - 1, x - 1); 33 | int t2 = dp(k, n - x); 34 | 35 | if (t1 < t2) 36 | { 37 | lo = x; 38 | } 39 | else if (t1 > t2) 40 | { 41 | hi = x; 42 | } 43 | else 44 | { 45 | lo = hi = x; 46 | } 47 | } 48 | 49 | ans = 1 + min(max(dp(k - 1, lo - 1), dp(k, n - lo)), 50 | max(dp(k - 1, hi - 1), dp(k, n - hi))); 51 | } 52 | return ans; 53 | } 54 | 55 | int main() 56 | { 57 | cin >> nx >> kx >> ny >> ky; 58 | int fx = dp(ky, nx); 59 | int fy = dp(kx, ny); 60 | 61 | system("pause"); 62 | return 0; 63 | } 64 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605201234.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | int dp(int k, int n) 19 | { 20 | 21 | int ans; 22 | if (n == 0) 23 | ans = 0; 24 | else if (k == 1) 25 | ans = n; 26 | else 27 | { 28 | int lo = 1, hi = n; 29 | while (lo + 1 < hi) 30 | { 31 | int x = (lo + hi) / 2; 32 | int t1 = dp(k - 1, x - 1); 33 | int t2 = dp(k, n - x); 34 | 35 | if (t1 < t2) 36 | { 37 | lo = x; 38 | } 39 | else if (t1 > t2) 40 | { 41 | hi = x; 42 | } 43 | else 44 | { 45 | lo = hi = x; 46 | } 47 | } 48 | 49 | ans = 1 + min(max(dp(k - 1, lo - 1), dp(k, n - lo)), 50 | max(dp(k - 1, hi - 1), dp(k, n - hi))); 51 | } 52 | return ans; 53 | } 54 | 55 | int main() 56 | { 57 | cin >> nx >> kx >> ny >> ky; 58 | int fx = dp(ky, nx); 59 | int fy = dp(kx, ny); 60 | cout << min(fx, fy); 61 | 62 | system("pause"); 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605201307.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | int dp(int k, int n) 19 | { 20 | int ans; 21 | if (n == 0) 22 | return 0; 23 | else if (k == 1) 24 | return n; 25 | else 26 | { 27 | int lo = 1, hi = n; 28 | while (lo + 1 < hi) 29 | { 30 | int x = (lo + hi) / 2; 31 | int t1 = dp(k - 1, x - 1); 32 | int t2 = dp(k, n - x); 33 | 34 | if (t1 < t2) 35 | { 36 | lo = x; 37 | } 38 | else if (t1 > t2) 39 | { 40 | hi = x; 41 | } 42 | else 43 | { 44 | lo = hi = x; 45 | } 46 | } 47 | 48 | ans = 1 + min(max(dp(k - 1, lo - 1), dp(k, n - lo)), 49 | max(dp(k - 1, hi - 1), dp(k, n - hi))); 50 | } 51 | return ans; 52 | } 53 | 54 | int main() 55 | { 56 | cin >> nx >> kx >> ny >> ky; 57 | int fx = dp(ky, nx); 58 | int fy = dp(kx, ny); 59 | cout << min(fx, fy); 60 | 61 | system("pause"); 62 | return 0; 63 | } 64 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605201410.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | 19 | int dp(int k, int n) 20 | { 21 | int ans; 22 | if (n == 0) 23 | return 0; 24 | else if (k == 1) 25 | return n; 26 | else 27 | { 28 | int lo = 1, hi = n; 29 | while (lo + 1 < hi) 30 | { 31 | int x = (lo + hi) / 2; 32 | int t1 = dp(k - 1, x - 1); 33 | int t2 = dp(k, n - x); 34 | 35 | if (t1 < t2) 36 | { 37 | lo = x; 38 | } 39 | else if (t1 > t2) 40 | { 41 | hi = x; 42 | } 43 | else 44 | { 45 | lo = hi = x; 46 | } 47 | } 48 | 49 | ans = 1 + min(max(dp(k - 1, lo - 1), dp(k, n - lo)), 50 | max(dp(k - 1, hi - 1), dp(k, n - hi))); 51 | } 52 | return ans; 53 | } 54 | 55 | int main() 56 | { 57 | cin >> nx >> kx >> ny >> ky; 58 | int fx = dp(ky, nx); 59 | int fy = dp(kx, ny); 60 | cout << min(fx, fy); 61 | 62 | system("pause"); 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605201444.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | 19 | int dp(int k, int n) 20 | { 21 | int ans; 22 | if (n == 0) 23 | return 0; 24 | else if (k == 1) 25 | return n; 26 | else 27 | { 28 | int low = 1, high = n; 29 | while (low + 1 < high) 30 | { 31 | int x = (low + high) / 2; 32 | int t1 = dp(k - 1, x - 1); 33 | int t2 = dp(k, n - x); 34 | 35 | if (t1 < t2) 36 | { 37 | low = x; 38 | } 39 | else if (t1 > t2) 40 | { 41 | high = x; 42 | } 43 | else 44 | { 45 | low = high = x; 46 | } 47 | } 48 | 49 | ans = 1 + min(max(dp(k - 1, low - 1), dp(k, n - low)), 50 | max(dp(k - 1, high - 1), dp(k, n - high))); 51 | } 52 | return ans; 53 | } 54 | 55 | int main() 56 | { 57 | cin >> nx >> kx >> ny >> ky; 58 | int fx = dp(ky, nx); 59 | int fy = dp(kx, ny); 60 | cout << min(fx, fy); 61 | 62 | system("pause"); 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605201445.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | 19 | int dp(int k, int n) 20 | { 21 | int ans; 22 | if (n == 0) 23 | return 0; 24 | else if (k == 1) 25 | return n; 26 | else 27 | { 28 | int low = 1, high = n; 29 | while (low + 1 < high) 30 | { 31 | int x = (low + high) / 2; 32 | int t1 = dp(k - 1, x - 1); 33 | int t2 = dp(k, n - x); 34 | 35 | if (t1 < t2) 36 | { 37 | low = x; 38 | } 39 | else if (t1 > t2) 40 | { 41 | high = x; 42 | } 43 | else 44 | { 45 | low = high = x; 46 | } 47 | } 48 | 49 | ans = 1 + min(max(dp(k - 1, low - 1), dp(k, n - low)), 50 | max(dp(k - 1, high - 1), dp(k, n - high))); 51 | } 52 | return ans; 53 | } 54 | 55 | int main() 56 | { 57 | cin >> nx >> kx >> ny >> ky; 58 | int fx = dp(ky, nx); 59 | int fy = dp(kx, ny); 60 | cout << min(fx, fy); 61 | 62 | system("pause"); 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605201514.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | 19 | int dp(int k, int n) 20 | { 21 | int ans; 22 | if (n == 0) 23 | return 0; 24 | else if (k == 1) 25 | return n; 26 | else 27 | { 28 | int low = 1, high = n; 29 | while (low + 1 < high) 30 | { 31 | int x = (low + high) / 2; 32 | int t1 = dp(k - 1, x - 1); 33 | int t2 = dp(k, n - x); 34 | 35 | if (t1 < t2) 36 | 37 | low = x; 38 | 39 | else if (t1 > t2) 40 | { 41 | high = x; 42 | } 43 | else 44 | { 45 | low = high = x; 46 | } 47 | } 48 | 49 | ans = 1 + min(max(dp(k - 1, low - 1), dp(k, n - low)), 50 | max(dp(k - 1, high - 1), dp(k, n - high))); 51 | } 52 | return ans; 53 | } 54 | 55 | int main() 56 | { 57 | cin >> nx >> kx >> ny >> ky; 58 | int fx = dp(ky, nx); 59 | int fy = dp(kx, ny); 60 | cout << min(fx, fy); 61 | 62 | system("pause"); 63 | return 0; 64 | } 65 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605201524.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | 19 | int dp(int k, int n) 20 | { 21 | int ans; 22 | if (n == 0) 23 | return 0; 24 | else if (k == 1) 25 | return n; 26 | else 27 | { 28 | int low = 1, high = n; 29 | while (low + 1 < high) 30 | { 31 | int x = (low + high) / 2; 32 | int t1 = dp(k - 1, x - 1); 33 | int t2 = dp(k, n - x); 34 | 35 | if (t1 < t2) 36 | low = x; 37 | else if (t1 > t2) 38 | high = x; 39 | else 40 | low = high = x; 41 | } 42 | 43 | ans = 1 + min(max(dp(k - 1, low - 1), dp(k, n - low)), 44 | max(dp(k - 1, high - 1), dp(k, n - high))); 45 | } 46 | return ans; 47 | } 48 | 49 | int main() 50 | { 51 | cin >> nx >> kx >> ny >> ky; 52 | int fx = dp(ky, nx); 53 | int fy = dp(kx, ny); 54 | cout << min(fx, fy); 55 | 56 | system("pause"); 57 | return 0; 58 | } 59 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605201536.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | 19 | int dp(int k, int n) 20 | { 21 | int ans; 22 | if (n == 0) 23 | return 0; 24 | else if (k == 1) 25 | return n; 26 | else 27 | { 28 | int low = 1, high = n; 29 | while (low + 1 < high) 30 | { 31 | int x = (low + high) / 2; 32 | int t1 = dp(k - 1, x - 1); 33 | int t2 = dp(k, n - x); 34 | 35 | if (t1 < t2) 36 | low = x; 37 | else if (t1 > t2) 38 | high = x; 39 | else 40 | low = high = x; 41 | } 42 | 43 | ans = min(max(dp(k - 1, low - 1), dp(k, n - low)), 44 | max(dp(k - 1, high - 1), dp(k, n - high))) + 45 | 1; 46 | } 47 | return ans; 48 | } 49 | 50 | int main() 51 | { 52 | cin >> nx >> kx >> ny >> ky; 53 | int fx = dp(ky, nx); 54 | int fy = dp(kx, ny); 55 | cout << min(fx, fy); 56 | 57 | system("pause"); 58 | return 0; 59 | } 60 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605201550.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | 19 | int dp(int k, int n) 20 | { 21 | int ans; 22 | if (n == 0) 23 | return 0; 24 | else if (k == 1) 25 | return n; 26 | else 27 | { 28 | int low = 1, high = n; 29 | while (low + 1 < high) 30 | { 31 | int x = (low + high) / 2; 32 | int t1 = dp(k - 1, x - 1); 33 | int t2 = dp(k, n - x); 34 | 35 | if (t1 < t2) 36 | low = x; 37 | else if (t1 > t2) 38 | high = x; 39 | else 40 | low = high = x; 41 | } 42 | 43 | ans = min(max(dp(k - 1, low - 1), dp(k, n - low)), 44 | max(dp(k - 1, high - 1), dp(k, n - high))) + 45 | 1; 46 | } 47 | return ans; 48 | } 49 | 50 | int main() 51 | { 52 | cin >> nx >> kx >> ny >> ky; 53 | int fx = dp(ky, nx); 54 | int fy = dp(kx, ny); 55 | cout << min(fx, fy); 56 | 57 | system("pause"); 58 | return 0; 59 | } 60 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605201851.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | using namespace std; 17 | int nx, kx, ny, ky; 18 | #define SIZE 32 19 | int c[SIZE][SIZE] = {0}; 20 | int dp(int k, int n) 21 | { 22 | int ans; 23 | if (n == 0) 24 | { 25 | c[k][n] = 0; 26 | return 0; 27 | } 28 | 29 | else if (k == 1) 30 | { 31 | c[k][n] = n; 32 | return n; 33 | } 34 | 35 | else 36 | { 37 | int low = 1, high = n; 38 | while (low + 1 < high) 39 | { 40 | int x = (low + high) / 2; 41 | int t1 = dp(k - 1, x - 1); 42 | int t2 = dp(k, n - x); 43 | 44 | if (t1 < t2) 45 | low = x; 46 | else if (t1 > t2) 47 | high = x; 48 | else 49 | low = high = x; 50 | } 51 | 52 | ans = min(max(dp(k - 1, low - 1), dp(k, n - low)), 53 | max(dp(k - 1, high - 1), dp(k, n - high))) + 54 | 1; 55 | } 56 | return ans; 57 | } 58 | 59 | int main() 60 | { 61 | cin >> nx >> kx >> ny >> ky; 62 | int fx = dp(ky, nx); 63 | int fy = dp(kx, ny); 64 | cout << min(fx, fy); 65 | 66 | system("pause"); 67 | return 0; 68 | } 69 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605202006.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | #include 17 | using namespace std; 18 | int nx, kx, ny, ky; 19 | #define SIZE 32 20 | int c[SIZE][SIZE] = {0}; 21 | int dp(int k, int n) 22 | { 23 | int ans; 24 | if (n == 0) 25 | { 26 | c[k][n] = 0; 27 | return 0; 28 | } 29 | 30 | else if (k == 1) 31 | { 32 | c[k][n] = n; 33 | return n; 34 | } 35 | else 36 | { 37 | int low = 1, high = n; 38 | while (low + 1 < high) 39 | { 40 | int x = (low + high) / 2; 41 | int t1 = dp(k - 1, x - 1); 42 | int t2 = dp(k, n - x); 43 | 44 | if (t1 < t2) 45 | low = x; 46 | else if (t1 > t2) 47 | high = x; 48 | else 49 | low = high = x; 50 | } 51 | ans = min(max(c[k - 1][low - 1] dp(k - 1, low - 1), dp(k, n - low)), 52 | max(dp(k - 1, high - 1), dp(k, n - high))) + 53 | 1; 54 | // ans = min(max(dp(k - 1, low - 1), dp(k, n - low)), 55 | // max(dp(k - 1, high - 1), dp(k, n - high))) + 56 | // 1; 57 | } 58 | return ans; 59 | } 60 | 61 | int main() 62 | { 63 | cin >> nx >> kx >> ny >> ky; 64 | int fx = dp(ky, nx); 65 | int fy = dp(kx, ny); 66 | cout << min(fx, fy); 67 | 68 | system("pause"); 69 | return 0; 70 | } 71 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605202042.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | #include 17 | using namespace std; 18 | int nx, kx, ny, ky; 19 | #define SIZE 32 20 | vector> c[SIZE][SIZE] = {0}; 21 | int dp(int k, int n) 22 | { 23 | int ans; 24 | if (n == 0) 25 | { 26 | c[k][n] = 0; 27 | return 0; 28 | } 29 | 30 | else if (k == 1) 31 | { 32 | c[k][n] = n; 33 | return n; 34 | } 35 | else 36 | { 37 | int low = 1, high = n; 38 | while (low + 1 < high) 39 | { 40 | int x = (low + high) / 2; 41 | int t1 = dp(k - 1, x - 1); 42 | int t2 = dp(k, n - x); 43 | 44 | if (t1 < t2) 45 | low = x; 46 | else if (t1 > t2) 47 | high = x; 48 | else 49 | low = high = x; 50 | } 51 | ans = min(max(c[k - 1][low - 1] dp(k - 1, low - 1), dp(k, n - low)), 52 | max(dp(k - 1, high - 1), dp(k, n - high))) + 53 | 1; 54 | // ans = min(max(dp(k - 1, low - 1), dp(k, n - low)), 55 | // max(dp(k - 1, high - 1), dp(k, n - high))) + 56 | // 1; 57 | } 58 | return ans; 59 | } 60 | 61 | int main() 62 | { 63 | cin >> nx >> kx >> ny >> ky; 64 | int fx = dp(ky, nx); 65 | int fy = dp(kx, ny); 66 | cout << min(fx, fy); 67 | 68 | system("pause"); 69 | return 0; 70 | } 71 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605202052.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | #include 17 | using namespace std; 18 | int nx, kx, ny, ky; 19 | #define SIZE 32 20 | vector> c[SIZE][SIZE]; 21 | int dp(int k, int n) 22 | { 23 | int ans; 24 | if (n == 0) 25 | { 26 | c[k][n] = 0; 27 | return 0; 28 | } 29 | 30 | else if (k == 1) 31 | { 32 | c[k][n] = n; 33 | return n; 34 | } 35 | else 36 | { 37 | int low = 1, high = n; 38 | while (low + 1 < high) 39 | { 40 | int x = (low + high) / 2; 41 | int t1 = dp(k - 1, x - 1); 42 | int t2 = dp(k, n - x); 43 | 44 | if (t1 < t2) 45 | low = x; 46 | else if (t1 > t2) 47 | high = x; 48 | else 49 | low = high = x; 50 | } 51 | ans = min(max(c[k - 1][low - 1] dp(k - 1, low - 1), dp(k, n - low)), 52 | max(dp(k - 1, high - 1), dp(k, n - high))) + 53 | 1; 54 | // ans = min(max(dp(k - 1, low - 1), dp(k, n - low)), 55 | // max(dp(k - 1, high - 1), dp(k, n - high))) + 56 | // 1; 57 | } 58 | return ans; 59 | } 60 | 61 | int main() 62 | { 63 | cin >> nx >> kx >> ny >> ky; 64 | int fx = dp(ky, nx); 65 | int fy = dp(kx, ny); 66 | cout << min(fx, fy); 67 | 68 | system("pause"); 69 | return 0; 70 | } 71 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605202122.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | #include 17 | using namespace std; 18 | int nx, kx, ny, ky; 19 | vector> c; 20 | int dp(int k, int n) 21 | { 22 | int ans; 23 | if (n == 0) 24 | { 25 | c[k][n] = 0; 26 | return 0; 27 | } 28 | 29 | else if (k == 1) 30 | { 31 | c[k][n] = n; 32 | return n; 33 | } 34 | else 35 | { 36 | int low = 1, high = n; 37 | while (low + 1 < high) 38 | { 39 | int x = (low + high) / 2; 40 | int t1 = dp(k - 1, x - 1); 41 | int t2 = dp(k, n - x); 42 | 43 | if (t1 < t2) 44 | low = x; 45 | else if (t1 > t2) 46 | high = x; 47 | else 48 | low = high = x; 49 | } 50 | ans = min(max(c[k - 1][low - 1] dp(k - 1, low - 1), dp(k, n - low)), 51 | max(dp(k - 1, high - 1), dp(k, n - high))) + 52 | 1; 53 | // ans = min(max(dp(k - 1, low - 1), dp(k, n - low)), 54 | // max(dp(k - 1, high - 1), dp(k, n - high))) + 55 | // 1; 56 | } 57 | return ans; 58 | } 59 | 60 | int main() 61 | { 62 | cin >> nx >> kx >> ny >> ky; 63 | int fx = dp(ky, nx); 64 | int fy = dp(kx, ny); 65 | cout << min(fx, fy); 66 | 67 | system("pause"); 68 | return 0; 69 | } 70 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605202213.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | #include 17 | using namespace std; 18 | int nx, kx, ny, ky; 19 | vector> c; 20 | int superEggDrop(int k, int n) 21 | { 22 | int dp[n + 1]; 23 | for (int i = 0; i <= n; ++i) 24 | { 25 | dp[i] = i; 26 | } 27 | 28 | for (int j = 2; j <= k; ++j) 29 | { 30 | int dp2[n + 1]; 31 | int x = 1; 32 | dp2[0] = 0; 33 | for (int m = 1; m <= n; ++m) 34 | { 35 | while (x < m && max(dp[x - 1], dp2[m - x]) >= max(dp[x], dp2[m - x - 1])) 36 | { 37 | x++; 38 | } 39 | dp2[m] = 1 + max(dp[x - 1], dp2[m - x]); 40 | } 41 | for (int m = 1; m <= n; ++m) 42 | { 43 | dp[m] = dp2[m]; 44 | } 45 | } 46 | return dp[n]; 47 | } 48 | 49 | int main() 50 | { 51 | cin >> nx >> kx >> ny >> ky; 52 | int fx = dp(ky, nx); 53 | int fy = dp(kx, ny); 54 | cout << min(fx, fy); 55 | 56 | system("pause"); 57 | return 0; 58 | } 59 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605202302.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | #include 17 | using namespace std; 18 | int nx, kx, ny, ky; 19 | int dp(int k, int n) 20 | { 21 | int *dp = new int(n + 1); 22 | for (int i = 0; i <= n; ++i) 23 | { 24 | dp[i] = i; 25 | } 26 | 27 | for (int j = 2; j <= k; ++j) 28 | { 29 | int dp2[n + 1]; 30 | int x = 1; 31 | dp2[0] = 0; 32 | for (int m = 1; m <= n; ++m) 33 | { 34 | while (x < m && max(dp[x - 1], dp2[m - x]) >= max(dp[x], dp2[m - x - 1])) 35 | { 36 | x++; 37 | } 38 | dp2[m] = 1 + max(dp[x - 1], dp2[m - x]); 39 | } 40 | for (int m = 1; m <= n; ++m) 41 | { 42 | dp[m] = dp2[m]; 43 | } 44 | } 45 | return dp[n]; 46 | } 47 | 48 | int main() 49 | { 50 | cin >> nx >> kx >> ny >> ky; 51 | int fx = dp(ky, nx); 52 | int fy = dp(kx, ny); 53 | cout << min(fx, fy); 54 | 55 | system("pause"); 56 | return 0; 57 | } 58 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605202307.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | #include 17 | using namespace std; 18 | int nx, kx, ny, ky; 19 | int dp(int k, int n) 20 | { 21 | int *dp = new int(n + 1); 22 | for (int i = 0; i <= n; ++i) 23 | 24 | dp[i] = i; 25 | 26 | for (int j = 2; j <= k; ++j) 27 | { 28 | int dp2[n + 1]; 29 | int x = 1; 30 | dp2[0] = 0; 31 | for (int m = 1; m <= n; ++m) 32 | { 33 | while (x < m && max(dp[x - 1], dp2[m - x]) >= max(dp[x], dp2[m - x - 1])) 34 | { 35 | x++; 36 | } 37 | dp2[m] = 1 + max(dp[x - 1], dp2[m - x]); 38 | } 39 | for (int m = 1; m <= n; ++m) 40 | { 41 | dp[m] = dp2[m]; 42 | } 43 | } 44 | return dp[n]; 45 | } 46 | 47 | int main() 48 | { 49 | cin >> nx >> kx >> ny >> ky; 50 | int fx = dp(ky, nx); 51 | int fy = dp(kx, ny); 52 | cout << min(fx, fy); 53 | 54 | system("pause"); 55 | return 0; 56 | } 57 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605202309.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | #include 17 | using namespace std; 18 | int nx, kx, ny, ky; 19 | int dp(int k, int n) 20 | { 21 | int *dp = new int(n + 1); 22 | for (int i = 0; i <= n; ++i) 23 | dp[i] = i; 24 | 25 | for (int j = 2; j <= k; ++j) 26 | { 27 | int dp2[n + 1]; 28 | int x = 1; 29 | dp2[0] = 0; 30 | for (int m = 1; m <= n; ++m) 31 | { 32 | while (x < m && max(dp[x - 1], dp2[m - x]) >= max(dp[x], dp2[m - x - 1])) 33 | { 34 | x++; 35 | } 36 | dp2[m] = 1 + max(dp[x - 1], dp2[m - x]); 37 | } 38 | for (int m = 1; m <= n; ++m) 39 | { 40 | dp[m] = dp2[m]; 41 | } 42 | } 43 | return dp[n]; 44 | } 45 | 46 | int main() 47 | { 48 | cin >> nx >> kx >> ny >> ky; 49 | int fx = dp(ky, nx); 50 | int fy = dp(kx, ny); 51 | cout << min(fx, fy); 52 | 53 | system("pause"); 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605202321.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | #include 17 | using namespace std; 18 | int nx, kx, ny, ky; 19 | int dp(int k, int n) 20 | { 21 | int *dp = new int(n + 1); 22 | for (int i = 0; i <= n; ++i) 23 | dp[i] = i; 24 | 25 | for (int j = 2; j <= k; ++j) 26 | { 27 | int *dp2 = new int(n + 1); 28 | int x = 1; 29 | dp2[0] = 0; 30 | for (int m = 1; m <= n; ++m) 31 | { 32 | while (x < m && max(dp[x - 1], dp2[m - x]) >= max(dp[x], dp2[m - x - 1])) 33 | { 34 | x++; 35 | } 36 | dp2[m] = 1 + max(dp[x - 1], dp2[m - x]); 37 | } 38 | for (int m = 1; m <= n; ++m) 39 | { 40 | dp[m] = dp2[m]; 41 | } 42 | } 43 | return dp[n]; 44 | } 45 | 46 | int main() 47 | { 48 | cin >> nx >> kx >> ny >> ky; 49 | int fx = dp(ky, nx); 50 | int fy = dp(kx, ny); 51 | cout << min(fx, fy); 52 | 53 | system("pause"); 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605203754.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | #include 17 | using namespace std; 18 | int nx, kx, ny, ky; 19 | int dp(int k, int n) 20 | { 21 | int *dp = new int(n + 1); 22 | for (int i = 0; i <= n; ++i) 23 | dp[i] = i; 24 | 25 | for (int j = 2; j <= k; ++j) 26 | { 27 | int *dp2 = new int(n + 1); 28 | int x = 1; 29 | dp2[0] = 0; 30 | for (int m = 1; m <= n; ++m) 31 | { 32 | while (x < m && max(dp[x - 1], dp2[m - x]) >= max(dp[x], dp2[m - x - 1])) 33 | { 34 | x++; 35 | } 36 | dp2[m] = 1 + max(dp[x - 1], dp2[m - x]); 37 | } 38 | for (int m = 1; m <= n; ++m) 39 | { 40 | dp[m] = dp2[m]; 41 | } 42 | } 43 | return dp[n]; 44 | } 45 | 46 | int main() 47 | { 48 | cin >> nx >> kx >> ny >> ky; 49 | int fx = dp(ky, nx); 50 | int fy = dp(kx, ny); 51 | cout << min(fx, fy); 52 | 53 | system("pause"); 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605203818.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | #include 17 | using namespace std; 18 | int nx, kx, ny, ky; 19 | int dp(int k, int n) 20 | { 21 | int *dp = new int(n + 2); 22 | for (int i = 0; i <= n; ++i) 23 | dp[i] = i; 24 | 25 | for (int j = 2; j <= k; ++j) 26 | { 27 | int *dp2 = new int(n + 2); 28 | int x = 1; 29 | dp2[0] = 0; 30 | for (int m = 1; m <= n; ++m) 31 | { 32 | while (x < m && max(dp[x - 1], dp2[m - x]) >= max(dp[x], dp2[m - x - 1])) 33 | { 34 | x++; 35 | } 36 | dp2[m] = 1 + max(dp[x - 1], dp2[m - x]); 37 | } 38 | for (int m = 1; m <= n; ++m) 39 | { 40 | dp[m] = dp2[m]; 41 | } 42 | } 43 | return dp[n]; 44 | } 45 | 46 | int main() 47 | { 48 | cin >> nx >> kx >> ny >> ky; 49 | int fx = dp(ky, nx); 50 | int fy = dp(kx, ny); 51 | cout << min(fx, fy); 52 | 53 | system("pause"); 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.history/2_20220605204133.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | // #include 17 | using namespace std; 18 | int nx, kx, ny, ky; 19 | int dp(int k, int n) 20 | { 21 | int *dp = new int(n + 2); 22 | for (int i = 0; i <= n; ++i) 23 | dp[i] = i; 24 | 25 | for (int j = 2; j <= k; ++j) 26 | { 27 | int *dp2 = new int(n + 2); 28 | int x = 1; 29 | dp2[0] = 0; 30 | for (int m = 1; m <= n; ++m) 31 | { 32 | while (x < m && max(dp[x - 1], dp2[m - x]) >= max(dp[x], dp2[m - x - 1])) 33 | { 34 | x++; 35 | } 36 | dp2[m] = 1 + max(dp[x - 1], dp2[m - x]); 37 | } 38 | for (int m = 1; m <= n; ++m) 39 | { 40 | dp[m] = dp2[m]; 41 | } 42 | } 43 | return dp[n]; 44 | } 45 | 46 | int main() 47 | { 48 | cin >> nx >> kx >> ny >> ky; 49 | int fx = dp(ky, nx); 50 | int fy = dp(kx, ny); 51 | cout << min(fx, fy); 52 | 53 | system("pause"); 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.vscode/10.txt: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | */ 4 | #include 5 | #include "stdio.h" 6 | using namespace std; 7 | int main() 8 | { 9 | 10 | system("pause"); 11 | return 0; 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.vscode/edit.txt: -------------------------------------------------------------------------------- 1 | 2021暑期活动纪录片 -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "g++.exe - 生成和调试活动文件", 9 | "type": "cppdbg", 10 | "request": "launch", 11 | "program": "${fileDirname}\\${fileBasenameNoExtension}.exe", 12 | "args": [], 13 | "stopAtEntry": false, 14 | "cwd": "D:\\mingw64\\bin\\", 15 | "environment": [], 16 | "externalConsole": true, 17 | "MIMode": "gdb", 18 | "miDebuggerPath": "D:\\mingw64\\bin\\gdb.exe", 19 | "setupCommands": [ 20 | { 21 | "description": "为 gdb 启用整齐打印", 22 | "text": "-enable-pretty-printing", 23 | "ignoreFailures": true 24 | } 25 | ], 26 | "preLaunchTask": "C/C++: g++.exe build active file" 27 | } 28 | ] 29 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.vscode/makefile: -------------------------------------------------------------------------------- 1 | obj=main.o 2 | target = main 3 | CC = g++ 4 | 5 | $(target) : $(obj) 6 | 7 | $(CC) $(obj) -o $(target) 8 | 9 | %.o :%.cpp 10 | $(CC) $< -c -o $@ -g 11 | 12 | clean: 13 | rm *.o main -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "iostream": "cpp", 4 | "xstring": "cpp", 5 | "string": "cpp", 6 | "xutility": "cpp", 7 | "utility": "cpp" 8 | } 9 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/7/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "tasks": [ 3 | { 4 | "type": "cppbuild", 5 | "label": "C/C++: g++.exe build active file", 6 | "command": "D:\\mingw64\\bin\\g++.exe", 7 | "args": [ 8 | "-g", 9 | "${file}", 10 | "-o", 11 | "${fileDirname}\\${fileBasenameNoExtension}.exe", 12 | "-std=c++17" 13 | ], 14 | "options": { 15 | "cwd": "D:\\mingw64\\bin" 16 | }, 17 | "problemMatcher": [ 18 | "$gcc" 19 | ], 20 | "group": { 21 | "kind": "build", 22 | "isDefault": true 23 | }, 24 | "detail": "Task generated by Debugger." 25 | } 26 | ], 27 | "version": "2.0.0" 28 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/7/1.1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/7/1.1.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/7/1.2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/7/1.2.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/7/1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/7/1.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/7/2.1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "stdio.h" 3 | #include 4 | using namespace std; 5 | int nx, kx, ny, ky; 6 | #define INT_MAX 2147483647 7 | int dp(int k, int n) 8 | { 9 | vector> c(k, vector(n + 1, INT_MAX)); // k egg n+1 floor 10 | 11 | for (int i = 0; i < k; i++) // zero floor 12 | c[i][0] = 0; 13 | for (int j = 1; j <= n; j++) // one egg 14 | c[0][j] = j; 15 | for (int i = 1; i < k; i++) // egg 16 | for (int j = 1; j <= n; j++) // floor 17 | { 18 | int low = 1, high = j; 19 | int tmp = 0; //操作次数 20 | while (low <= high) 21 | { 22 | int mid = low + (high - low) / 2; 23 | int t1 = c[i - 1][mid - 1]; // broke, go down 24 | int t2 = c[i][j - mid]; // survive, floor higher 25 | tmp = 1 + max(t1, t2); 26 | c[i][j] = min(c[i][j], tmp); 27 | if (t1 > t2) 28 | { 29 | high = mid - 1; 30 | } 31 | else if (t1 < t2) 32 | { 33 | low = mid + 1; 34 | } 35 | else 36 | { 37 | break; 38 | } 39 | } 40 | } 41 | return c[k-1][n]; 42 | } 43 | 44 | int main() 45 | { 46 | cin >> nx >> kx >> ny >> ky; 47 | int fx = dp(ky, nx); 48 | int fy = dp(kx, ny); 49 | cout << min(fx, fy); 50 | 51 | system("pause"); 52 | return 0; 53 | } 54 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/2.1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/7/2.1.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/7/2.cpp: -------------------------------------------------------------------------------- 1 | #define DEBUG 2 | /* 3 | 叫什么高楼抛鸡蛋 4 | 输入样例1: 5 | 6 | 5 2 7 | 8 | 7 1 9 | 10 | 输出样例1: 11 | 12 | 4 13 | */ 14 | #include 15 | #include "stdio.h" 16 | // #include 17 | using namespace std; 18 | int nx, kx, ny, ky; 19 | int dp(int k, int n) 20 | { 21 | int *dp = new int(n + 2); 22 | for (int i = 0; i <= n; ++i) 23 | dp[i] = i; 24 | 25 | for (int j = 2; j <= k; ++j) 26 | { 27 | int *dp2 = new int(n + 2); 28 | int x = 1; 29 | dp2[0] = 0; 30 | for (int m = 1; m <= n; ++m) 31 | { 32 | while (x < m && max(dp[x - 1], dp2[m - x]) >= max(dp[x], dp2[m - x - 1])) 33 | { 34 | x++; 35 | } 36 | dp2[m] = 1 + max(dp[x - 1], dp2[m - x]); 37 | } 38 | for (int m = 1; m <= n; ++m) 39 | { 40 | dp[m] = dp2[m]; 41 | } 42 | } 43 | return dp[n]; 44 | } 45 | 46 | int main() 47 | { 48 | cin >> nx >> kx >> ny >> ky; 49 | int fx = dp(ky, nx); 50 | int fy = dp(kx, ny); 51 | cout << min(fx, fy); 52 | 53 | system("pause"); 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /Algorithm算法/Code/7/2.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/7/2.exe -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/Graph_20220524184200.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/Wheels/.history/Graph_20220524184200.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/Graph_20220524184202.cpp: -------------------------------------------------------------------------------- 1 | class Graph 2 | { 3 | public: 4 | bool onpath[SIZE]; 5 | list adj[SIZE]; 6 | bool visited[SIZE]; 7 | long long count; 8 | 9 | // function to add an edge to graph 10 | void addEdge(int v, int w); 11 | 12 | // DFS_path traversal of the vertices 13 | // reachable from v 14 | int DFS(int v, int w); 15 | int DFS_path(int v); 16 | }; 17 | 18 | int Graph::DFS(int v, int w) 19 | { 20 | // Mark the current node as visited and 21 | // print it 22 | if (v == w) 23 | return 1; 24 | visited[v] = true; 25 | // cout << v << " "; 26 | 27 | // Recur for all the vertices adjacent 28 | // to this vertex 29 | for (auto i = adj[v].begin(); i != adj[v].end(); ++i) 30 | if (!visited[*i]) 31 | return DFS(*i, w); 32 | return 0; 33 | } 34 | 35 | void Graph::addEdge(int v, int w) 36 | { 37 | adj[v].push_back(w); // Add w to v’s list. 38 | } 39 | -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/Graph_20220524184239.cpp: -------------------------------------------------------------------------------- 1 | #define SIZE 1000005 2 | class Graph 3 | { 4 | public: 5 | bool onpath[SIZE]; 6 | list adj[SIZE]; 7 | bool visited[SIZE]; 8 | long long count; 9 | 10 | // function to add an edge to graph 11 | void addEdge(int v, int w); 12 | 13 | // DFS_path traversal of the vertices 14 | // reachable from v 15 | int DFS(int v, int w); 16 | int DFS_path(int v); 17 | }; 18 | 19 | int Graph::DFS(int v, int w) 20 | { 21 | // Mark the current node as visited and 22 | // print it 23 | if (v == w) 24 | return 1; 25 | visited[v] = true; 26 | // cout << v << " "; 27 | 28 | // Recur for all the vertices adjacent 29 | // to this vertex 30 | for (auto i = adj[v].begin(); i != adj[v].end(); ++i) 31 | if (!visited[*i]) 32 | return DFS(*i, w); 33 | return 0; 34 | } 35 | 36 | void Graph::addEdge(int v, int w) 37 | { 38 | adj[v].push_back(w); // Add w to v’s list. 39 | } 40 | -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/binary_search_20220428152209.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/Wheels/.history/binary_search_20220428152209.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/binary_search_20220428152219.cpp: -------------------------------------------------------------------------------- 1 | // C++ program to implement recursive Binary Search 2 | #include 3 | using namespace std; 4 | 5 | // A recursive binary search function. It returns 6 | // location of x in given array arr[l..r] is present, 7 | // otherwise -1 8 | int binarySearch(int arr[], int l, int r, int x) 9 | { 10 | if (r >= l) { 11 | int mid = l + (r - l) / 2; 12 | 13 | // If the element is present at the middle 14 | // itself 15 | if (arr[mid] == x) 16 | return mid; 17 | 18 | // If element is smaller than mid, then 19 | // it can only be present in left subarray 20 | if (arr[mid] > x) 21 | return binarySearch(arr, l, mid - 1, x); 22 | 23 | // Else the element can only be present 24 | // in right subarray 25 | return binarySearch(arr, mid + 1, r, x); 26 | } 27 | 28 | // We reach here when element is not 29 | // present in array 30 | return -1; 31 | } 32 | 33 | int main(void) 34 | { 35 | int arr[] = { 2, 3, 4, 10, 40 }; 36 | int x = 10; 37 | int n = sizeof(arr) / sizeof(arr[0]); 38 | int result = binarySearch(arr, 0, n - 1, x); 39 | (result == -1) 40 | ? cout << "Element is not present in array" 41 | : cout << "Element is present at index " << result; 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/dfs_20220504200045.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/Wheels/.history/dfs_20220504200045.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/dfs_20220504200050.cpp: -------------------------------------------------------------------------------- 1 | // C++ program to print DFS traversal from 2 | // a given vertex in a given graph 3 | #include 4 | using namespace std; 5 | 6 | // Graph class represents a directed graph 7 | // using adjacency list representation 8 | class Graph { 9 | public: 10 | map visited; 11 | map > adj; 12 | 13 | // function to add an edge to graph 14 | void addEdge(int v, int w); 15 | 16 | // DFS traversal of the vertices 17 | // reachable from v 18 | void DFS(int v); 19 | }; 20 | 21 | void Graph::addEdge(int v, int w) 22 | { 23 | adj[v].push_back(w); // Add w to v’s list. 24 | } 25 | 26 | void Graph::DFS(int v) 27 | { 28 | // Mark the current node as visited and 29 | // print it 30 | visited[v] = true; 31 | cout << v << " "; 32 | 33 | // Recur for all the vertices adjacent 34 | // to this vertex 35 | list::iterator i; 36 | for (i = adj[v].begin(); i != adj[v].end(); ++i) 37 | if (!visited[*i]) 38 | DFS(*i); 39 | } 40 | 41 | // Driver code 42 | int main() 43 | { 44 | // Create a graph given in the above diagram 45 | Graph g; 46 | g.addEdge(0, 1); 47 | g.addEdge(0, 2); 48 | g.addEdge(1, 2); 49 | g.addEdge(2, 0); 50 | g.addEdge(2, 3); 51 | g.addEdge(3, 3); 52 | 53 | cout << "Following is Depth First Traversal" 54 | " (starting from vertex 2) \n"; 55 | g.DFS(2); 56 | 57 | return 0; 58 | } 59 | 60 | // improved by Vishnudev C 61 | -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/dfs_20220504200202.cpp: -------------------------------------------------------------------------------- 1 | // C++ program to print DFS traversal from 2 | // a given vertex in a given graph 3 | #include 4 | using namespace std; 5 | 6 | // Graph class represents a directed graph 7 | // using adjacency list representation 8 | class Graph { 9 | public: 10 | map visited; 11 | map > adj; 12 | 13 | // function to add an edge to graph 14 | void addEdge(int v, int w); 15 | 16 | // DFS traversal of the vertices 17 | // reachable from v 18 | void DFS(int v); 19 | }; 20 | 21 | void Graph::addEdge(int v, int w) 22 | { 23 | adj[v].push_back(w); // Add w to v’s list. 24 | } 25 | 26 | void Graph::DFS(int v) 27 | { 28 | // Mark the current node as visited and 29 | // print it 30 | visited[v] = true; 31 | // cout << v << " "; 32 | 33 | // Recur for all the vertices adjacent 34 | // to this vertex 35 | list::iterator i; 36 | for (i = adj[v].begin(); i != adj[v].end(); ++i) 37 | if (!visited[*i]) 38 | DFS(*i); 39 | } 40 | -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/dfs_20220504200219.cpp: -------------------------------------------------------------------------------- 1 | // C++ program to print DFS traversal from 2 | // a given vertex in a given graph 3 | #include 4 | using namespace std; 5 | 6 | // Graph class represents a directed graph 7 | // using adjacency list representation 8 | class Graph { 9 | public: 10 | map visited; 11 | map > adj; 12 | 13 | // function to add an edge to graph 14 | void addEdge(int v, int w); 15 | 16 | // DFS traversal of the vertices 17 | // reachable from v 18 | void DFS(int v); 19 | }; 20 | 21 | void Graph::addEdge(int v, int w) 22 | { 23 | adj[v].push_back(w); // Add w to v’s list. 24 | } 25 | 26 | void Graph::DFS(int v) 27 | { 28 | // Mark the current node as visited and 29 | // print it 30 | visited[v] = true; 31 | // cout << v << " "; 32 | 33 | // Recur for all the vertices adjacent 34 | // to this vertex 35 | auto i; 36 | for (i = adj[v].begin(); i != adj[v].end(); ++i) 37 | if (!visited[*i]) 38 | DFS(*i); 39 | } 40 | -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/dfs_20220504203924.cpp: -------------------------------------------------------------------------------- 1 | // C++ program to print DFS traversal from 2 | // a given vertex in a given graph 3 | #include 4 | using namespace std; 5 | 6 | // Graph class represents a directed graph 7 | // using adjacency list representation 8 | class Graph { 9 | public: 10 | map visited; 11 | map > adj; 12 | 13 | // function to add an edge to graph 14 | void addEdge(int v, int w); 15 | 16 | // DFS traversal of the vertices 17 | // reachable from v 18 | void DFS(int v); 19 | }; 20 | 21 | void Graph::addEdge(int v, int w) 22 | { 23 | adj[v].push_back(w); // Add w to v’s list. 24 | } 25 | 26 | void Graph::DFS(int v) 27 | { 28 | // Mark the current node as visited and 29 | // print it 30 | visited[v] = true; 31 | // cout << v << " "; 32 | 33 | // Recur for all the vertices adjacent 34 | // to this vertex 35 | list::iterator i; 36 | for (i = adj[v].begin(); i != adj[v].end(); ++i) 37 | if (!visited[*i]) 38 | DFS(*i); 39 | } 40 | -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/select_20220428150518.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/Wheels/.history/select_20220428150518.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/select_20220428150521.cpp: -------------------------------------------------------------------------------- 1 | 2 | int kth_smallest(int arr[], int l, int r, int k) 3 | { 4 | if (k < 0 || k > r - l + 1) 5 | { 6 | return -1; 7 | } 8 | // partition the array (similar to quicksort) 9 | int index = partition(arr, l, r); 10 | 11 | // if position same as k return rank-k element 12 | if (index - l == k - 1) 13 | return t(index,arr); 14 | 15 | // if rank-k element is less, look in left sub-array 16 | if (index - l > k - 1) 17 | return kth_smallest(arr, l, index - 1, k); 18 | else // look in right sub-array 19 | return kth_smallest(arr, index + 1, r, k - index + l - 1); 20 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/select_20220428150534.cpp: -------------------------------------------------------------------------------- 1 | 2 | int partition(int a[], int l, int r) // basic partition 3 | { 4 | int i = l; 5 | int j = r; 6 | int pivot = t(l, a); 7 | while (i < j) 8 | { 9 | while (t(j, a) >= pivot && i < j) 10 | j--; 11 | t(i, a) = t(j, a); 12 | while (t(i, a) <= pivot && i < j) 13 | i++; 14 | t(j, a) = t(i, a); 15 | } 16 | t(i, a) = pivot; 17 | return i; 18 | } 19 | int kth_smallest(int arr[], int l, int r, int k) 20 | { 21 | if (k < 0 || k > r - l + 1) 22 | { 23 | return -1; 24 | } 25 | // partition the array (similar to quicksort) 26 | int index = partition(arr, l, r); 27 | 28 | // if position same as k return rank-k element 29 | if (index - l == k - 1) 30 | return t(index,arr); 31 | 32 | // if rank-k element is less, look in left sub-array 33 | if (index - l > k - 1) 34 | return kth_smallest(arr, l, index - 1, k); 35 | else // look in right sub-array 36 | return kth_smallest(arr, index + 1, r, k - index + l - 1); 37 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/select_20220428150622.cpp: -------------------------------------------------------------------------------- 1 | int partition(int a[], int l, int r) // basic partition 2 | { 3 | int i = l; 4 | int j = r; 5 | int pivot = a[l]; 6 | while (i < j) 7 | { 8 | while (a[j] >= pivot && i < j) 9 | j--; 10 | a[i] = a[j]; 11 | while (a[i] <= pivot && i < j) 12 | i++; 13 | a[j] = a[i]; 14 | } 15 | a[i] = pivot; 16 | return i; 17 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/select_20220428150636.cpp: -------------------------------------------------------------------------------- 1 | int partition(int a[], int l, int r) // basic partition 2 | { 3 | int i = l; 4 | int j = r; 5 | int pivot = a[l]; 6 | while (i < j) 7 | { 8 | while (a[j] >= pivot && i < j) 9 | j--; 10 | a[i] = a[j]; 11 | while (a[i] <= pivot && i < j) 12 | i++; 13 | a[j] = a[i]; 14 | } 15 | a[i] = pivot; 16 | return i; 17 | } 18 | int kth_smallest(int arr[], int l, int r, int k) 19 | { 20 | if (k < 0 || k > r - l + 1) 21 | { 22 | return -1; 23 | } 24 | // partition the array (similar to quicksort) 25 | int index = partition(arr, l, r); 26 | 27 | // if position same as k return rank-k element 28 | if (index - l == k - 1) 29 | return arr[index]; 30 | 31 | // if rank-k element is less, look in left sub-array 32 | if (index - l > k - 1) 33 | return kth_smallest(arr, l, index - 1, k); 34 | else // look in right sub-array 35 | return kth_smallest(arr, index + 1, r, k - index + l - 1); 36 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/select_20220504203815.cpp: -------------------------------------------------------------------------------- 1 | int partition(int a[], int l, int r) // basic partition 2 | { 3 | int i = l; 4 | int j = r; 5 | int pivot = a[l]; 6 | while (i < j) 7 | { 8 | while (a[j] >= pivot && i < j) 9 | j--; 10 | a[i] = a[j]; 11 | while (a[i] <= pivot && i < j) 12 | i++; 13 | a[j] = a[i]; 14 | } 15 | a[i] = pivot; 16 | return i; 17 | } 18 | int kth_smallest(int arr[], int l, int r, int k) 19 | { 20 | if (k < 0 || k > r - l + 1) 21 | { 22 | return -1; 23 | } 24 | // partition the array (similar to quicksort) 25 | int index = partition(arr, l, r); 26 | 27 | // if position same as k return rank-k element 28 | if (index - l == k - 1) 29 | return arr[index]; 30 | 31 | // if rank-k element is less, look in left sub-array 32 | if (index - l > k - 1) 33 | return kth_smallest(arr, l, index - 1, k); 34 | else // look in right sub-array 35 | return kth_smallest(arr, index + 1, r, k - index + l - 1); 36 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/union-find_20220504203857.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/Wheels/.history/union-find_20220504203857.cpp -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/.history/union-find_20220504203922.cpp: -------------------------------------------------------------------------------- 1 | int find(int x, int f[]) 2 | { 3 | if (f[x] != x) 4 | f[x] = find(f[x], f); 5 | return f[x]; 6 | } 7 | 8 | void merge(int x, int y, int f[]) 9 | { 10 | int fx = find(f[x], f); 11 | int fy = find(f[y], f); 12 | f[fx] = fy; 13 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/Graph.cpp: -------------------------------------------------------------------------------- 1 | #define SIZE 1000005 2 | class Graph 3 | { 4 | public: 5 | bool onpath[SIZE]; 6 | list adj[SIZE]; 7 | bool visited[SIZE]; 8 | long long count; 9 | 10 | // function to add an edge to graph 11 | void addEdge(int v, int w); 12 | 13 | // DFS_path traversal of the vertices 14 | // reachable from v 15 | int DFS(int v, int w); 16 | int DFS_path(int v); 17 | }; 18 | 19 | int Graph::DFS(int v, int w) 20 | { 21 | // Mark the current node as visited and 22 | // print it 23 | if (v == w) 24 | return 1; 25 | visited[v] = true; 26 | // cout << v << " "; 27 | 28 | // Recur for all the vertices adjacent 29 | // to this vertex 30 | for (auto i = adj[v].begin(); i != adj[v].end(); ++i) 31 | if (!visited[*i]) 32 | return DFS(*i, w); 33 | return 0; 34 | } 35 | 36 | void Graph::addEdge(int v, int w) 37 | { 38 | adj[v].push_back(w); // Add w to v’s list. 39 | } 40 | -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/binary_search.cpp: -------------------------------------------------------------------------------- 1 | // C++ program to implement recursive Binary Search 2 | #include 3 | using namespace std; 4 | 5 | // A recursive binary search function. It returns 6 | // location of x in given array arr[l..r] is present, 7 | // otherwise -1 8 | int binarySearch(int arr[], int l, int r, int x) 9 | { 10 | if (r >= l) { 11 | int mid = l + (r - l) / 2; 12 | 13 | // If the element is present at the middle 14 | // itself 15 | if (arr[mid] == x) 16 | return mid; 17 | 18 | // If element is smaller than mid, then 19 | // it can only be present in left subarray 20 | if (arr[mid] > x) 21 | return binarySearch(arr, l, mid - 1, x); 22 | 23 | // Else the element can only be present 24 | // in right subarray 25 | return binarySearch(arr, mid + 1, r, x); 26 | } 27 | 28 | // We reach here when element is not 29 | // present in array 30 | return -1; 31 | } 32 | 33 | int main(void) 34 | { 35 | int arr[] = { 2, 3, 4, 10, 40 }; 36 | int x = 10; 37 | int n = sizeof(arr) / sizeof(arr[0]); 38 | int result = binarySearch(arr, 0, n - 1, x); 39 | (result == -1) 40 | ? cout << "Element is not present in array" 41 | : cout << "Element is present at index " << result; 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/dfs.cpp: -------------------------------------------------------------------------------- 1 | // C++ program to print DFS traversal from 2 | // a given vertex in a given graph 3 | #include 4 | using namespace std; 5 | 6 | // Graph class represents a directed graph 7 | // using adjacency list representation 8 | class Graph { 9 | public: 10 | map visited; 11 | map > adj; 12 | 13 | // function to add an edge to graph 14 | void addEdge(int v, int w); 15 | 16 | // DFS traversal of the vertices 17 | // reachable from v 18 | void DFS(int v); 19 | }; 20 | 21 | void Graph::addEdge(int v, int w) 22 | { 23 | adj[v].push_back(w); // Add w to v’s list. 24 | } 25 | 26 | void Graph::DFS(int v) 27 | { 28 | // Mark the current node as visited and 29 | // print it 30 | visited[v] = true; 31 | // cout << v << " "; 32 | 33 | // Recur for all the vertices adjacent 34 | // to this vertex 35 | list::iterator i; 36 | for (i = adj[v].begin(); i != adj[v].end(); ++i) 37 | if (!visited[*i]) 38 | DFS(*i); 39 | } 40 | -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/select.cpp: -------------------------------------------------------------------------------- 1 | int partition(int a[], int l, int r) // basic partition 2 | { 3 | int i = l; 4 | int j = r; 5 | int pivot = a[l]; 6 | while (i < j) 7 | { 8 | while (a[j] >= pivot && i < j) 9 | j--; 10 | a[i] = a[j]; 11 | while (a[i] <= pivot && i < j) 12 | i++; 13 | a[j] = a[i]; 14 | } 15 | a[i] = pivot; 16 | return i; 17 | } 18 | int kth_smallest(int arr[], int l, int r, int k) 19 | { 20 | if (k < 0 || k > r - l + 1) 21 | { 22 | return -1; 23 | } 24 | // partition the array (similar to quicksort) 25 | int index = partition(arr, l, r); 26 | 27 | // if position same as k return rank-k element 28 | if (index - l == k - 1) 29 | return arr[index]; 30 | 31 | // if rank-k element is less, look in left sub-array 32 | if (index - l > k - 1) 33 | return kth_smallest(arr, l, index - 1, k); 34 | else // look in right sub-array 35 | return kth_smallest(arr, index + 1, r, k - index + l - 1); 36 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/Wheels/union-find.cpp: -------------------------------------------------------------------------------- 1 | int find(int x, int f[]) 2 | { 3 | if (f[x] != x) 4 | f[x] = find(f[x], f); 5 | return f[x]; 6 | } 7 | 8 | void merge(int x, int y, int f[]) 9 | { 10 | int fx = find(f[x], f); 11 | int fy = find(f[y], f); 12 | f[fx] = fy; 13 | } -------------------------------------------------------------------------------- /Algorithm算法/Code/回形排序相关说明.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Code/回形排序相关说明.pdf -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_2833.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_2833.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_2834.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_2834.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_2835.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_2835.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_2836.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_2836.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_2837.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_2837.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_2838.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_2838.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_2839.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_2839.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_2840.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_2840.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_2841.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_2841.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_2842.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_2842.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_2843.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_2843.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_2844.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_2844.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_2845.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_2845.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_2846.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_2846.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_2847.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_2847.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_3033.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_3033.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_3034.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_3034.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_3035.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_3035.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_3036.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_3036.JPG -------------------------------------------------------------------------------- /Algorithm算法/Homework/friends/IMG_3037.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/Homework/friends/IMG_3037.JPG -------------------------------------------------------------------------------- /Algorithm算法/README.md: -------------------------------------------------------------------------------- 1 | # 南京大学2021春季 算法设计与分析 2 | 3 | **南京大学计算机科学与技术系2022秋课程 算法设计与分析 个人笔记** 4 | 5 | 仅以此仓库作为行动的第一步,星星之火可以燎原,共享经验以节约大家的生命,反对封闭的体系。 6 | 7 | **真心希望这份答案能帮你更好的纠错,或者能让你在DDL前睡一个好觉,甚至和喜欢的人多出去玩一会儿。** 8 | 9 | 但是每个选择都有其代价,多了一个可能性是用以更好的安排自己的时间,而不是一个摆的捷径。 10 | 11 | 欢迎批评补充,学术交流,您可以邮件联系我( 201220058@smail.nju.edu.cn ) 12 | 13 | ## 课程信息 14 | 15 | 教师:徐经纬 16 | 17 | 教科书: 18 | 19 | 推荐黄宇老师蓝色书,薄薄的很贴心。 20 | 21 | 个人正好有一本大黑书《算法导论》,对于想深入研究的概念可以拿这个当作字典查找。 22 | 23 | 南大教务网推荐书目如下 24 | 25 | > 26 | > (一) 教科书:S.Baase and A.V. Gelder, Computer Algorithms – Introduction to Design and Analysis, Pearson Education, Higher Education Press, 2001. 27 | > 28 | > (二) 参考书:T.H. Cormen, C.E. Leiserson, R.L. Rivest and C. Stein, Introduction to Algorithms, The MIT press, Higher Education Press. 29 | 30 | ## 自学指南 31 | 32 | 看b栈二位大师足矣,刷完黄老师某一年的录屏,线下听下助教习题课就行了。 33 | 34 | 徐老师可做补充。 35 | 36 | 夹带私货,我也做了一个算法的视频,有关对手论证哦 37 | 38 | 黄宇:https://space.bilibili.com/474662253/ 39 | 40 | 徐经纬:https://space.bilibili.com/390606417 41 | 42 | 王珊:https://space.bilibili.com/17387202 43 | 44 | ## 文件指南 45 | 46 | ├─Code 作业代码,皆为正解,有题目原文 47 | ├─Homework 几次个人作业答案 48 | ├─总复习 期末个人总结+参考前辈总结 49 | ├─笔记 平日笔记 50 | ├─答案 助教发的官方答案 51 | ├─试卷 往年卷子等 52 | │ └─样题 53 | └─课件 部分课件 54 | 55 | 课件可以看github南大408考研,里面有黄宇2015的课件,变化不大。 56 | 57 | 个人觉得最有价值的是**答案和卷子**s,2021年习题课和某位助教的博客快照,如果学期一开始就拿到很有助于自学。 58 | 59 | 卷子有徐经纬期中。需要更多也可以联系我找找。 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /Algorithm算法/南大2015级算法课件 - 快捷方式.lnk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/南大2015级算法课件 - 快捷方式.lnk -------------------------------------------------------------------------------- /Algorithm算法/总复习/算法设计与分析 期末.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/总复习/算法设计与分析 期末.pdf -------------------------------------------------------------------------------- /Algorithm算法/笔记/Algorithm U1.md: -------------------------------------------------------------------------------- 1 | # Algorithm U1 2 | 3 | ## 1.抽象算法的设计与分析 4 | 5 | ### Algorithm - the spirit of computing 6 | 7 | • Model of computation 语言无关 8 | 9 | ### Algorithm design and analysis 10 | 11 | • Design 12 | • Correctness proof by induction 数归 13 | • Analysis 14 | • Worst-case / average-case complexity 即 期望 15 | 16 | ## 2.从算法的视角从新审视数学概念 17 | 18 | ### Asymptotic growth rate 19 | 20 | Ο, Ω, Θ 21 | o, ω 22 | 23 | ### Brute force algorithms 24 | 25 | By iteration 26 | By recursion -------------------------------------------------------------------------------- /Algorithm算法/笔记/Algorithm U3--recursion.md: -------------------------------------------------------------------------------- 1 | # Algorithm U3--recursion 2 | 3 | 插入排序 4 | 5 | ![1646014030775](C:\Users\Lenovo\AppData\Roaming\Typora\typora-user-images\1646014030775.png) -------------------------------------------------------------------------------- /Algorithm算法/笔记/Algorithm U6 L8.md: -------------------------------------------------------------------------------- 1 | # Algorithm U6 logn 2 | 3 | ## 1. Review 4 | 5 | - Selection –warm up 6 | Max and min 两两一组 7 | Second largest 回溯loss to max 8 | - Selection –Rank k (median) 9 | Expected linear time 不均等划分 10 | Worst-case linear time 强行均等 11 | - Adversary argument 12 | Lower bound 13 | 14 | ## 2. logn 15 | 16 | ### 2.1 要求 17 | 18 | 每次都要减小一半啊,均等最好,不均等就平均logn,w(n)=n 19 | 20 | 每次都要减小一半,所以都是有序列 21 | 22 | Binary Search 二分查找 23 | 24 | ### 2.2 Binary search tree (BST) 25 | 26 | 还记得吗 二叉搜索,左树更小,右树更大 27 | 28 | ### 2.3 Definition of Red-Black Tree (RBT) 29 | 30 | p62 + 笔记 31 | 32 | #### RBT 33 | 34 | - 红色不连续 35 | - 黑色叶子高度一样 36 | - 根为黑 37 | 38 | #### ARB 39 | 40 | - 根为红 41 | 42 | #### 递归定义 43 | 44 | 略 45 | 46 | ### RBT operations 47 | 48 | Insertion into a red-black tree 49 | Deletion from a red-black tree -------------------------------------------------------------------------------- /Algorithm算法/笔记/Algorithm U8 Graph.md: -------------------------------------------------------------------------------- 1 | # Algorithm U8 Graph 2 | 3 | 4 | 5 | ![1649852411223](C:\Users\Lenovo\AppData\Roaming\Typora\typora-user-images\1649852411223.png) -------------------------------------------------------------------------------- /Algorithm算法/笔记/查找数组中第k大的数.md: -------------------------------------------------------------------------------- 1 | ## [查找数组中第k大的数](https://www.cnblogs.com/wsw-seu/p/7652495.html) 2 | 3 | 问题: 查找出一给定数组中第k大的数。例如[3,2,7,1,8,9,6,5,4],第1大的数是9,第2大的数是8…… 4 | 5 | 思考:1. 直接从大到小排序,排好序后,第k大的数就是arr[k-1]。 6 | 7 | \2. 只需找到第k大的数,不必把所有的数排好序。我们借助快[速排序](http://blog.csdn.net/zhangxiangdavaid/article/details/25436609)中partition过程,一般情况下,在把所有数都排好序前,就可以找到第k大的数。我们依据的逻辑是,经过一次partition后,数组被pivot分成左右两部分:S左、S右。**当S左的元素个数|S左|等于k-1时,pivot即是所找的数**;**当|S左|小于k-1,所找的数位于S右中;当|S左|>k-1,所找的数位于S左中。**显然,后两种情况都会使搜索空间缩小。 8 | 9 | 算法的时间复杂度为:O(N)--详情参考算法导论 10 | 11 | -------------------------------------------------------------------------------- /Algorithm算法/答案/P1~P3 & OJ1~OJ3习题讲解.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/答案/P1~P3 & OJ1~OJ3习题讲解.pdf -------------------------------------------------------------------------------- /Algorithm算法/答案/P1~P3要点总结.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/答案/P1~P3要点总结.pdf -------------------------------------------------------------------------------- /Algorithm算法/答案/P4~7.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/答案/P4~7.pdf -------------------------------------------------------------------------------- /Algorithm算法/答案/P7(1).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/答案/P7(1).pdf -------------------------------------------------------------------------------- /Algorithm算法/答案/算法答案csdn(助教已删除.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/答案/算法答案csdn(助教已删除.pdf -------------------------------------------------------------------------------- /Algorithm算法/试卷/201220058_王珊.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/试卷/201220058_王珊.pdf -------------------------------------------------------------------------------- /Algorithm算法/试卷/2022年春季-期中试题.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/试卷/2022年春季-期中试题.docx -------------------------------------------------------------------------------- /Algorithm算法/试卷/期中考试参考答案.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/试卷/期中考试参考答案.pdf -------------------------------------------------------------------------------- /Algorithm算法/试卷/期中试卷讲解.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/试卷/期中试卷讲解.pdf -------------------------------------------------------------------------------- /Algorithm算法/试卷/样题/QQ图片20220617162659.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/试卷/样题/QQ图片20220617162659.jpg -------------------------------------------------------------------------------- /Algorithm算法/试卷/样题/QQ图片20220617162810.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/试卷/样题/QQ图片20220617162810.jpg -------------------------------------------------------------------------------- /Algorithm算法/试卷/样题/QQ图片20220617162818.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/试卷/样题/QQ图片20220617162818.jpg -------------------------------------------------------------------------------- /Algorithm算法/课件/L1 - Model of computation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/课件/L1 - Model of computation.pdf -------------------------------------------------------------------------------- /Algorithm算法/课件/L2 - Asymptotics(1).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/课件/L2 - Asymptotics(1).pdf -------------------------------------------------------------------------------- /Algorithm算法/课件/L3 - Recursion(1).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/课件/L3 - Recursion(1).pdf -------------------------------------------------------------------------------- /Algorithm算法/课件/L4 - QuickSort.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/课件/L4 - QuickSort.pdf -------------------------------------------------------------------------------- /Algorithm算法/课件/L5 - HeapSort.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/课件/L5 - HeapSort.pdf -------------------------------------------------------------------------------- /Algorithm算法/课件/L7 - Selection(1).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shannju/njucser_helphelp/336534b5afebad11fb12dd6093b7c1e82dc21a03/Algorithm算法/课件/L7 - Selection(1).pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # njucser_helphelp 2 | 南京大学计算机系生存经验。仅供交流学习。初学计算机,错误良多,恳请批评指正。 3 | 4 | 仅以此仓库作为行动的第一步,星星之火可以燎原,共享经验以节约大家的生命,反对封闭的体系。 5 | 6 | **真心希望这份答案能帮你更好的纠错,或者能让你在DDL前睡一个好觉,甚至和喜欢的人多出去玩一会儿。** 7 | 8 | 但是每个选择都有其代价,多了一个可能性是用以更好的安排自己的时间,而不是一个摆的捷径。 9 | 10 | 欢迎批评补充,学术交流,您可以邮件联系我( 201220058@smail.nju.edu.cn ) 11 | 12 | 个人网站 https://shannju.github.io/ 13 | --------------------------------------------------------------------------------