From c52b36c6a37fdb1d1de146d3939cb42e2c691f44 Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Sat, 5 Nov 2022 01:28:02 +0200 Subject: Solved 6 problem in filtrationContest and restructured the repo --- HackerRank/CountingSort1/CountingSort1.cpp | 19 +++ HackerRank/CountingSort2/CountingSort2.cpp | 21 +++ HackerRank/LonelyInteger/LonelyInteger.cpp | 12 ++ HackerRank/Luck_balance/Luck_balance.cpp | 37 +++++ codeforces/AlmostTernaryMatrix/main | Bin 0 -> 22624 bytes codeforces/AlmostTernaryMatrix/main.cpp | 20 +++ codeforces/AlmostTernaryMatrix/main_input0.txt | 4 + codeforces/AlmostTernaryMatrix/main_input1.txt | 2 + codeforces/AlmostTernaryMatrix/main_output0.txt | 8 ++ codeforces/ArrivalOfTheGeneral/inp | 0 codeforces/ArrivalOfTheGeneral/main | Bin 0 -> 34392 bytes codeforces/ArrivalOfTheGeneral/main.cpp | 27 ++++ codeforces/ArrivalOfTheGeneral/main_input0.txt | 2 + codeforces/ArrivalOfTheGeneral/main_input1.txt | 2 + codeforces/ArrivalOfTheGeneral/main_output0.txt | 1 + codeforces/ArrivalOfTheGeneral/main_output1.txt | 1 + codeforces/AvtoBus/AvtoBus.cpp | 16 +++ codeforces/BeautifulMatrix/inp | 0 codeforces/BeautifulMatrix/main | Bin 0 -> 22424 bytes codeforces/BeautifulMatrix/main.cpp | 20 +++ codeforces/BeautifulMatrix/main_input0.txt | 5 + codeforces/BeautifulMatrix/main_input1.txt | 5 + codeforces/BeautifulMatrix/main_output0.txt | 1 + codeforces/BeautifulMatrix/main_output1.txt | 1 + codeforces/BeautifulYear/inp | 0 codeforces/BeautifulYear/main | Bin 0 -> 45240 bytes codeforces/BeautifulYear/main.cpp | 21 +++ codeforces/BeautifulYear/main_input0.txt | 1 + codeforces/BeautifulYear/main_input1.txt | 1 + codeforces/BeautifulYear/main_output0.txt | 1 + codeforces/BeautifulYear/main_output1.txt | 1 + codeforces/BinarySearch/main | Bin 0 -> 27472 bytes codeforces/BinarySearch/main.cpp | 38 +++++ codeforces/BinarySearch/main_input0.txt | 3 + codeforces/BinarySearch/main_output0.txt | 10 ++ codeforces/Borze/inp | 0 codeforces/Borze/main | Bin 0 -> 626184 bytes codeforces/Borze/main.cpp | 14 ++ codeforces/Borze/main_input0.txt | 1 + codeforces/Borze/main_input1.txt | 1 + codeforces/Borze/main_input2.txt | 1 + codeforces/Borze/main_output0.txt | 1 + codeforces/Borze/main_output1.txt | 1 + codeforces/Borze/main_output2.txt | 1 + codeforces/BoyOrGirl/BoyOrGirl.cpp | 12 ++ codeforces/CamelCase/CamelCase.cpp | 16 +++ .../ConsecutivePointsSegment.cpp | 31 +++++ .../Diagonal_Difference/Diagonal_Difference.cpp | 30 ++++ codeforces/Dictionary/Dictionary.cpp | 22 +++ codeforces/DifferenceOperations/main | Bin 0 -> 27368 bytes codeforces/DifferenceOperations/main.cpp | 23 +++ codeforces/DifferenceOperations/main_input0.txt | 9 ++ codeforces/DifferenceOperations/main_input1.txt | 3 + codeforces/DifferenceOperations/main_input2.txt | 105 ++++++++++++++ codeforces/DifferenceOperations/main_input3.txt | 153 ++++++++++++++++++++ codeforces/DifferenceOperations/main_output0.txt | 4 + codeforces/DifferenceOperations/main_output1.txt | 1 + codeforces/DifferenceOperations/main_output2.txt | 52 +++++++ codeforces/DifferenceOperations/randomInput.txt | 154 +++++++++++++++++++++ .../DiffucltyRatingOrder/DiffucltyRatingOrder.cpp | 23 +++ codeforces/DormsRoom/DormsRoom.cpp | 30 ++++ codeforces/DpWithPrefixSum/main.cpp | 9 ++ codeforces/Drinks/inp | 0 codeforces/Drinks/main | Bin 0 -> 22376 bytes codeforces/Drinks/main.cpp | 19 +++ codeforces/Drinks/main_input0.txt | 2 + codeforces/Drinks/main_input1.txt | 2 + codeforces/Drinks/main_output0.txt | 1 + codeforces/Drinks/main_output1.txt | 1 + .../Equalize_the_array/Equalize_the_array.cpp | 19 +++ codeforces/EvenAndOdd/EvenAndOdd.cpp | 25 ++++ codeforces/FallDown/FallDown.cpp | 36 +++++ codeforces/Flipping_bits/Flipping_bits.cpp | 16 +++ codeforces/Football/Football.cpp | 18 +++ codeforces/FunkyNumbers/main | Bin 0 -> 40528 bytes codeforces/FunkyNumbers/main.cpp | 24 ++++ codeforces/FunkyNumbers/main_input0.txt | 1 + codeforces/FunkyNumbers/main_input1.txt | 1 + codeforces/FunkyNumbers/main_input2.txt | 1 + codeforces/FunkyNumbers/main_output0.txt | 1 + codeforces/FunkyNumbers/main_output1.txt | 1 + codeforces/FunkyNumbers/main_output2.txt | 1 + codeforces/Ghanophobia/main | Bin 0 -> 24608 bytes codeforces/Ghanophobia/main.cpp | 36 +++++ codeforces/Ghanophobia/main_input0.txt | 4 + codeforces/Ghanophobia/main_output0.txt | 3 + codeforces/HelpfulMaths/HelpfulMaths.cpp | 24 ++++ .../InfiniteReplacement/InfiniteReplacement.cpp | 26 ++++ codeforces/InfinityStaircase/InfinityStaircase.cpp | 24 ++++ codeforces/InsomiaCure/inp | 0 codeforces/InsomiaCure/main | Bin 0 -> 22576 bytes codeforces/InsomiaCure/main.cpp | 17 +++ codeforces/InsomiaCure/main_input0.txt | 5 + codeforces/InsomiaCure/main_input1.txt | 5 + codeforces/InsomiaCure/main_output0.txt | 1 + codeforces/InsomiaCure/main_output1.txt | 1 + codeforces/LightsOut/inp | 0 codeforces/LightsOut/main | Bin 0 -> 49856 bytes codeforces/LightsOut/main.cpp | 47 +++++++ codeforces/LightsOut/main_input0.txt | 3 + codeforces/LightsOut/main_input1.txt | 3 + codeforces/LightsOut/main_output0.txt | 3 + codeforces/LightsOut/main_output1.txt | 3 + codeforces/LisaWorkbook/LisaWorkbook.cpp | 25 ++++ codeforces/MakeItIncreasing/MakeItIncreasing.cpp | 24 ++++ codeforces/MarcCakwalk/MarcCakwalk.cpp | 18 +++ codeforces/MarkTheDustSweeper/main | Bin 0 -> 27320 bytes codeforces/MarkTheDustSweeper/main.cpp | 39 ++++++ codeforces/MarkTheDustSweeper/main_input0.txt | 9 ++ codeforces/MarkTheDustSweeper/main_output0.txt | 4 + codeforces/MarkThePhotographer/main | Bin 0 -> 44912 bytes codeforces/MarkThePhotographer/main.cpp | 31 +++++ codeforces/MarkThePhotographer/main_input0.txt | 7 + codeforces/MarkThePhotographer/main_output0.txt | 3 + codeforces/MaximizingXOR/MaximizingXOR.cpp | 17 +++ codeforces/MinDiffInArray/MinDiffInArray.cpp | 19 +++ codeforces/MirrorGrid/main | Bin 0 -> 30448 bytes codeforces/MirrorGrid/main.cpp | 30 ++++ codeforces/MirrorGrid/main_input0.txt | 25 ++++ codeforces/MirrorGrid/main_output0.txt | 5 + codeforces/NearlyLuckyNumber/inp | 0 codeforces/NearlyLuckyNumber/main | Bin 0 -> 25264 bytes codeforces/NearlyLuckyNumber/main.cpp | 31 +++++ codeforces/NearlyLuckyNumber/main_input0.txt | 1 + codeforces/NearlyLuckyNumber/main_input1.txt | 1 + codeforces/NearlyLuckyNumber/main_input2.txt | 1 + codeforces/NearlyLuckyNumber/main_output0.txt | 1 + codeforces/NearlyLuckyNumber/main_output1.txt | 1 + codeforces/NearlyLuckyNumber/main_output2.txt | 1 + codeforces/NumberReplacement/main.cpp | 20 +++ .../NumberTransformation/NumberTransformation.cpp | 31 +++++ .../Odd-EvenIncrements/Odd-EvenIncrements.cpp | 59 ++++++++ codeforces/ParanormixPredictions/inp | 0 codeforces/ParanormixPredictions/main | Bin 0 -> 32368 bytes codeforces/ParanormixPredictions/main.cpp | 25 ++++ codeforces/ParanormixPredictions/main_input0.txt | 1 + codeforces/ParanormixPredictions/main_input1.txt | 1 + codeforces/ParanormixPredictions/main_input2.txt | 1 + codeforces/ParanormixPredictions/main_output0.txt | 1 + codeforces/ParanormixPredictions/main_output1.txt | 1 + codeforces/ParanormixPredictions/main_output2.txt | 1 + .../PerfectlyBalancedString.cpp | 33 +++++ codeforces/PolyCarpAndDividend/main | Bin 0 -> 47448 bytes codeforces/PolyCarpAndDividend/main.cpp | 49 +++++++ codeforces/PrimeOrNot/PrimeOrNot.cpp | 16 +++ codeforces/QueueAtTheSchool/inp | 0 codeforces/QueueAtTheSchool/main | Bin 0 -> 626256 bytes codeforces/QueueAtTheSchool/main.cpp | 17 +++ codeforces/QueueAtTheSchool/main_input0.txt | 2 + codeforces/QueueAtTheSchool/main_input1.txt | 2 + codeforces/QueueAtTheSchool/main_input2.txt | 2 + codeforces/QueueAtTheSchool/main_output0.txt | 1 + codeforces/QueueAtTheSchool/main_output1.txt | 1 + codeforces/QueueAtTheSchool/main_output2.txt | 1 + codeforces/SequenceEquation/SequenceEquation.cpp | 25 ++++ codeforces/StonesOnTheTable/inp | 0 codeforces/StonesOnTheTable/main | Bin 0 -> 23408 bytes codeforces/StonesOnTheTable/main.cpp | 19 +++ codeforces/StonesOnTheTable/main_input0.txt | 2 + codeforces/StonesOnTheTable/main_input1.txt | 2 + codeforces/StonesOnTheTable/main_input2.txt | 2 + codeforces/StonesOnTheTable/main_output0.txt | 1 + codeforces/StonesOnTheTable/main_output1.txt | 1 + codeforces/StonesOnTheTable/main_output2.txt | 1 + codeforces/StringTask/StringTask.cpp | 20 +++ codeforces/SumsOfSubSequence/SumsOfSubSequence.cpp | 14 ++ codeforces/TakeDiscountOrNot/TakeDiscountOrNot.cpp | 18 +++ codeforces/ThePowerSum/ThePowerSum.cpp | 36 +++++ codeforces/TheThirdThreeNumberProblem/main | Bin 0 -> 22680 bytes codeforces/TheThirdThreeNumberProblem/main.cpp | 20 +++ .../TheThirdThreeNumberProblem/main_input0.txt | 6 + .../TheThirdThreeNumberProblem/main_output0.txt | 5 + codeforces/ThreeDoors/main | Bin 0 -> 22728 bytes codeforces/ThreeDoors/main.cpp | 23 +++ codeforces/ThreeDoors/main_input0.txt | 9 ++ codeforces/ThreeDoors/main_output0.txt | 4 + .../TokitsukazeAndAllZeroSequence.cpp | 38 +++++ codeforces/UltraFastMathmatician/inp | 0 codeforces/UltraFastMathmatician/main | Bin 0 -> 30640 bytes codeforces/UltraFastMathmatician/main.cpp | 15 ++ codeforces/UltraFastMathmatician/main_input0.txt | 2 + codeforces/UltraFastMathmatician/main_input1.txt | 2 + codeforces/UltraFastMathmatician/main_input2.txt | 2 + codeforces/UltraFastMathmatician/main_input3.txt | 2 + codeforces/UltraFastMathmatician/main_output0.txt | 1 + codeforces/UltraFastMathmatician/main_output1.txt | 1 + codeforces/UltraFastMathmatician/main_output2.txt | 1 + codeforces/UltraFastMathmatician/main_output3.txt | 1 + codeforces/Word/inp | 0 codeforces/Word/main | Bin 0 -> 24328 bytes codeforces/Word/main.cpp | 34 +++++ codeforces/Word/main_input0.txt | 1 + codeforces/Word/main_input1.txt | 1 + codeforces/Word/main_input2.txt | 1 + codeforces/Word/main_output0.txt | 1 + codeforces/Word/main_output1.txt | 1 + codeforces/Word/main_output2.txt | 1 + codeforces/WordCapitalization/inp | 0 codeforces/WordCapitalization/main | Bin 0 -> 23376 bytes codeforces/WordCapitalization/main.cpp | 12 ++ codeforces/WordCapitalization/main_input0.txt | 1 + codeforces/WordCapitalization/main_input1.txt | 1 + codeforces/WordCapitalization/main_output0.txt | 1 + codeforces/WordCapitalization/main_output1.txt | 1 + codeforces/WorkingWeek/main | Bin 0 -> 22600 bytes codeforces/WorkingWeek/main.cpp | 15 ++ codeforces/WorkingWeek/main_input0.txt | 4 + codeforces/WorkingWeek/main_output0.txt | 3 + codeforces/YoungPhysicist/YoungPhysicist.cpp | 22 +++ codeforces/beatTheOdds/inp | 5 + codeforces/beatTheOdds/main | Bin 0 -> 27104 bytes codeforces/beatTheOdds/main.cpp | 21 +++ codeforces/chocolateFeast/chocolateFeast.cpp | 43 ++++++ .../chocolateFeastRevised.cpp | 19 +++ codeforces/closestToTheLeft/main | Bin 0 -> 27424 bytes codeforces/closestToTheLeft/main.cpp | 36 +++++ codeforces/closestToTheLeft/main_input0.txt | 3 + codeforces/closestToTheLeft/main_output0.txt | 5 + codeforces/cubesShuffling/main | Bin 0 -> 44632 bytes codeforces/cubesShuffling/main.cpp | 41 ++++++ codeforces/cubesShuffling/main_input0.txt | 5 + codeforces/cubesShuffling/main_output0.txt | 4 + codeforces/cutTheSticks/cutTheSticks.cpp | 63 +++++++++ codeforces/cutTheSticksJoe/cutTheSticksJoe.cpp | 21 +++ .../cutTheSticksRevised/cutTheSticksRevised.cpp | 10 ++ codeforces/doubleStrings/main | Bin 0 -> 64192 bytes codeforces/doubleStrings/main.cpp | 32 +++++ codeforces/doubleStrings/main_input0.txt | 20 +++ codeforces/doubleStrings/main_output0.txt | 3 + codeforces/fastSearch/main | Bin 0 -> 27320 bytes codeforces/fastSearch/main.cpp | 25 ++++ codeforces/fastSearch/main_input0.txt | 7 + codeforces/fastSearch/main_output0.txt | 1 + codeforces/iceCreamParlor/iceCreamParlor.cpp | 38 +++++ codeforces/icpcBallons/main | Bin 0 -> 48656 bytes codeforces/icpcBallons/main.cpp | 28 ++++ codeforces/icpcBallons/main_input0.txt | 13 ++ codeforces/icpcBallons/main_output0.txt | 6 + codeforces/recursionTest/recursionTest.cpp | 51 +++++++ codeforces/strangeAddition/main | Bin 0 -> 46808 bytes codeforces/strangeAddition/main.cpp | 51 +++++++ codeforces/strangeAddition/main_input0.txt | 2 + codeforces/strangeAddition/main_input1.txt | 2 + codeforces/strangeAddition/main_output0.txt | 2 + codeforces/strangeAddition/main_output1.txt | 2 + codeforces/yapapsai/main | Bin 0 -> 32512 bytes codeforces/yapapsai/main.cpp | 26 ++++ codeforces/yapapsai/main_input0.txt | 11 ++ codeforces/yapapsai/main_output0.txt | 5 + codeforces/yesOrYes/main | Bin 0 -> 24208 bytes codeforces/yesOrYes/main.cpp | 23 +++ codeforces/yesOrYes/main_input0.txt | 11 ++ codeforces/yesOrYes/main_output0.txt | 10 ++ contests/filtrationContest/A/main | Bin 0 -> 53504 bytes contests/filtrationContest/A/main.cpp | 33 +++++ contests/filtrationContest/A/main_input0.txt | 11 ++ contests/filtrationContest/A/main_output0.txt | 5 + contests/filtrationContest/B/main | Bin 0 -> 22624 bytes contests/filtrationContest/B/main.cpp | 19 +++ contests/filtrationContest/B/main_input0.txt | 1 + contests/filtrationContest/B/main_output0.txt | 1 + contests/filtrationContest/C/main | Bin 0 -> 22528 bytes contests/filtrationContest/C/main.cpp | 23 +++ contests/filtrationContest/C/main_input0.txt | 2 + contests/filtrationContest/C/main_input1.txt | 2 + contests/filtrationContest/C/main_input2.txt | 2 + contests/filtrationContest/C/main_input3.txt | 2 + contests/filtrationContest/C/main_input4.txt | 2 + contests/filtrationContest/C/main_input5.txt | 2 + contests/filtrationContest/C/main_output0.txt | 1 + contests/filtrationContest/C/main_output1.txt | 1 + contests/filtrationContest/C/main_output2.txt | 1 + contests/filtrationContest/C/main_output3.txt | 1 + contests/filtrationContest/C/main_output4.txt | 1 + contests/filtrationContest/C/main_output5.txt | 1 + contests/filtrationContest/D/main.cpp | 15 ++ contests/filtrationContest/F/main.cpp | 26 ++++ contests/filtrationContest/G/main | Bin 0 -> 22584 bytes contests/filtrationContest/G/main.cpp | 20 +++ contests/filtrationContest/G/main_input0.txt | 6 + contests/filtrationContest/G/main_output0.txt | 5 + contests/filtrationContest/H/main | Bin 0 -> 82456 bytes contests/filtrationContest/H/main.cpp | 20 +++ contests/filtrationContest/H/main_input0.txt | 2 + contests/filtrationContest/H/main_output0.txt | 1 + contests/filtrationContest/I/main | Bin 0 -> 40640 bytes contests/filtrationContest/I/main.cpp | 20 +++ contests/filtrationContest/I/main_input0.txt | 2 + contests/filtrationContest/I/main_input1.txt | 2 + contests/filtrationContest/I/main_input2.txt | 2 + contests/filtrationContest/I/main_input3.txt | 2 + contests/filtrationContest/I/main_input4.txt | 2 + contests/filtrationContest/I/main_output0.txt | 1 + contests/filtrationContest/I/main_output1.txt | 1 + contests/filtrationContest/I/main_output2.txt | 1 + contests/filtrationContest/I/main_output3.txt | 1 + contests/filtrationContest/I/main_output4.txt | 1 + contests/filtrationContest/J/main | Bin 0 -> 27272 bytes contests/filtrationContest/J/main.cpp | 22 +++ contests/filtrationContest/J/main_input0.txt | 2 + contests/filtrationContest/J/main_input1.txt | 2 + contests/filtrationContest/J/main_input2.txt | 2 + contests/filtrationContest/J/main_input3.txt | 2 + contests/filtrationContest/J/main_output0.txt | 1 + contests/filtrationContest/J/main_output1.txt | 1 + contests/filtrationContest/J/main_output2.txt | 1 + contests/filtrationContest/J/main_output3.txt | 1 + contests/testcont/A/main.cpp | 13 ++ contests/testcont/B/main.cpp | 13 ++ contests/testcont/C/main.cpp | 13 ++ contests/testcont/D/main.cpp | 13 ++ contests/testcont/E/main.cpp | 13 ++ contests/testcont/F/main.cpp | 13 ++ cses/SortingAndSearching/Apartments/main.cpp | 24 ++++ cses/SortingAndSearching/SumOfTwoValues/main | Bin 0 -> 63968 bytes cses/SortingAndSearching/SumOfTwoValues/main.cpp | 29 ++++ .../SumOfTwoValues/main_input0.txt | 2 + .../SumOfTwoValues/main_input1.txt | 2 + .../SumOfTwoValues/main_output0.txt | 1 + .../SumOfTwoValues/main_output1.txt | 1 + 320 files changed, 3339 insertions(+) create mode 100644 HackerRank/CountingSort1/CountingSort1.cpp create mode 100644 HackerRank/CountingSort2/CountingSort2.cpp create mode 100644 HackerRank/LonelyInteger/LonelyInteger.cpp create mode 100644 HackerRank/Luck_balance/Luck_balance.cpp create mode 100755 codeforces/AlmostTernaryMatrix/main create mode 100644 codeforces/AlmostTernaryMatrix/main.cpp create mode 100644 codeforces/AlmostTernaryMatrix/main_input0.txt create mode 100644 codeforces/AlmostTernaryMatrix/main_input1.txt create mode 100644 codeforces/AlmostTernaryMatrix/main_output0.txt create mode 100644 codeforces/ArrivalOfTheGeneral/inp create mode 100755 codeforces/ArrivalOfTheGeneral/main create mode 100644 codeforces/ArrivalOfTheGeneral/main.cpp create mode 100644 codeforces/ArrivalOfTheGeneral/main_input0.txt create mode 100644 codeforces/ArrivalOfTheGeneral/main_input1.txt create mode 100644 codeforces/ArrivalOfTheGeneral/main_output0.txt create mode 100644 codeforces/ArrivalOfTheGeneral/main_output1.txt create mode 100644 codeforces/AvtoBus/AvtoBus.cpp create mode 100644 codeforces/BeautifulMatrix/inp create mode 100755 codeforces/BeautifulMatrix/main create mode 100644 codeforces/BeautifulMatrix/main.cpp create mode 100644 codeforces/BeautifulMatrix/main_input0.txt create mode 100644 codeforces/BeautifulMatrix/main_input1.txt create mode 100644 codeforces/BeautifulMatrix/main_output0.txt create mode 100644 codeforces/BeautifulMatrix/main_output1.txt create mode 100644 codeforces/BeautifulYear/inp create mode 100755 codeforces/BeautifulYear/main create mode 100644 codeforces/BeautifulYear/main.cpp create mode 100644 codeforces/BeautifulYear/main_input0.txt create mode 100644 codeforces/BeautifulYear/main_input1.txt create mode 100644 codeforces/BeautifulYear/main_output0.txt create mode 100644 codeforces/BeautifulYear/main_output1.txt create mode 100755 codeforces/BinarySearch/main create mode 100644 codeforces/BinarySearch/main.cpp create mode 100644 codeforces/BinarySearch/main_input0.txt create mode 100644 codeforces/BinarySearch/main_output0.txt create mode 100644 codeforces/Borze/inp create mode 100755 codeforces/Borze/main create mode 100644 codeforces/Borze/main.cpp create mode 100644 codeforces/Borze/main_input0.txt create mode 100644 codeforces/Borze/main_input1.txt create mode 100644 codeforces/Borze/main_input2.txt create mode 100644 codeforces/Borze/main_output0.txt create mode 100644 codeforces/Borze/main_output1.txt create mode 100644 codeforces/Borze/main_output2.txt create mode 100644 codeforces/BoyOrGirl/BoyOrGirl.cpp create mode 100644 codeforces/CamelCase/CamelCase.cpp create mode 100644 codeforces/ConsecutivePointsSegment/ConsecutivePointsSegment.cpp create mode 100644 codeforces/Diagonal_Difference/Diagonal_Difference.cpp create mode 100644 codeforces/Dictionary/Dictionary.cpp create mode 100755 codeforces/DifferenceOperations/main create mode 100644 codeforces/DifferenceOperations/main.cpp create mode 100644 codeforces/DifferenceOperations/main_input0.txt create mode 100644 codeforces/DifferenceOperations/main_input1.txt create mode 100644 codeforces/DifferenceOperations/main_input2.txt create mode 100644 codeforces/DifferenceOperations/main_input3.txt create mode 100644 codeforces/DifferenceOperations/main_output0.txt create mode 100644 codeforces/DifferenceOperations/main_output1.txt create mode 100644 codeforces/DifferenceOperations/main_output2.txt create mode 100644 codeforces/DifferenceOperations/randomInput.txt create mode 100644 codeforces/DiffucltyRatingOrder/DiffucltyRatingOrder.cpp create mode 100644 codeforces/DormsRoom/DormsRoom.cpp create mode 100644 codeforces/DpWithPrefixSum/main.cpp create mode 100644 codeforces/Drinks/inp create mode 100755 codeforces/Drinks/main create mode 100644 codeforces/Drinks/main.cpp create mode 100644 codeforces/Drinks/main_input0.txt create mode 100644 codeforces/Drinks/main_input1.txt create mode 100644 codeforces/Drinks/main_output0.txt create mode 100644 codeforces/Drinks/main_output1.txt create mode 100644 codeforces/Equalize_the_array/Equalize_the_array.cpp create mode 100644 codeforces/EvenAndOdd/EvenAndOdd.cpp create mode 100644 codeforces/FallDown/FallDown.cpp create mode 100644 codeforces/Flipping_bits/Flipping_bits.cpp create mode 100644 codeforces/Football/Football.cpp create mode 100755 codeforces/FunkyNumbers/main create mode 100644 codeforces/FunkyNumbers/main.cpp create mode 100644 codeforces/FunkyNumbers/main_input0.txt create mode 100644 codeforces/FunkyNumbers/main_input1.txt create mode 100644 codeforces/FunkyNumbers/main_input2.txt create mode 100644 codeforces/FunkyNumbers/main_output0.txt create mode 100644 codeforces/FunkyNumbers/main_output1.txt create mode 100644 codeforces/FunkyNumbers/main_output2.txt create mode 100755 codeforces/Ghanophobia/main create mode 100644 codeforces/Ghanophobia/main.cpp create mode 100644 codeforces/Ghanophobia/main_input0.txt create mode 100644 codeforces/Ghanophobia/main_output0.txt create mode 100644 codeforces/HelpfulMaths/HelpfulMaths.cpp create mode 100644 codeforces/InfiniteReplacement/InfiniteReplacement.cpp create mode 100644 codeforces/InfinityStaircase/InfinityStaircase.cpp create mode 100644 codeforces/InsomiaCure/inp create mode 100755 codeforces/InsomiaCure/main create mode 100644 codeforces/InsomiaCure/main.cpp create mode 100644 codeforces/InsomiaCure/main_input0.txt create mode 100644 codeforces/InsomiaCure/main_input1.txt create mode 100644 codeforces/InsomiaCure/main_output0.txt create mode 100644 codeforces/InsomiaCure/main_output1.txt create mode 100644 codeforces/LightsOut/inp create mode 100755 codeforces/LightsOut/main create mode 100644 codeforces/LightsOut/main.cpp create mode 100644 codeforces/LightsOut/main_input0.txt create mode 100644 codeforces/LightsOut/main_input1.txt create mode 100644 codeforces/LightsOut/main_output0.txt create mode 100644 codeforces/LightsOut/main_output1.txt create mode 100644 codeforces/LisaWorkbook/LisaWorkbook.cpp create mode 100644 codeforces/MakeItIncreasing/MakeItIncreasing.cpp create mode 100644 codeforces/MarcCakwalk/MarcCakwalk.cpp create mode 100755 codeforces/MarkTheDustSweeper/main create mode 100644 codeforces/MarkTheDustSweeper/main.cpp create mode 100644 codeforces/MarkTheDustSweeper/main_input0.txt create mode 100644 codeforces/MarkTheDustSweeper/main_output0.txt create mode 100755 codeforces/MarkThePhotographer/main create mode 100644 codeforces/MarkThePhotographer/main.cpp create mode 100644 codeforces/MarkThePhotographer/main_input0.txt create mode 100644 codeforces/MarkThePhotographer/main_output0.txt create mode 100644 codeforces/MaximizingXOR/MaximizingXOR.cpp create mode 100644 codeforces/MinDiffInArray/MinDiffInArray.cpp create mode 100755 codeforces/MirrorGrid/main create mode 100644 codeforces/MirrorGrid/main.cpp create mode 100644 codeforces/MirrorGrid/main_input0.txt create mode 100644 codeforces/MirrorGrid/main_output0.txt create mode 100644 codeforces/NearlyLuckyNumber/inp create mode 100755 codeforces/NearlyLuckyNumber/main create mode 100644 codeforces/NearlyLuckyNumber/main.cpp create mode 100644 codeforces/NearlyLuckyNumber/main_input0.txt create mode 100644 codeforces/NearlyLuckyNumber/main_input1.txt create mode 100644 codeforces/NearlyLuckyNumber/main_input2.txt create mode 100644 codeforces/NearlyLuckyNumber/main_output0.txt create mode 100644 codeforces/NearlyLuckyNumber/main_output1.txt create mode 100644 codeforces/NearlyLuckyNumber/main_output2.txt create mode 100644 codeforces/NumberReplacement/main.cpp create mode 100644 codeforces/NumberTransformation/NumberTransformation.cpp create mode 100644 codeforces/Odd-EvenIncrements/Odd-EvenIncrements.cpp create mode 100644 codeforces/ParanormixPredictions/inp create mode 100755 codeforces/ParanormixPredictions/main create mode 100644 codeforces/ParanormixPredictions/main.cpp create mode 100644 codeforces/ParanormixPredictions/main_input0.txt create mode 100644 codeforces/ParanormixPredictions/main_input1.txt create mode 100644 codeforces/ParanormixPredictions/main_input2.txt create mode 100644 codeforces/ParanormixPredictions/main_output0.txt create mode 100644 codeforces/ParanormixPredictions/main_output1.txt create mode 100644 codeforces/ParanormixPredictions/main_output2.txt create mode 100644 codeforces/PerfectlyBalancedString/PerfectlyBalancedString.cpp create mode 100755 codeforces/PolyCarpAndDividend/main create mode 100644 codeforces/PolyCarpAndDividend/main.cpp create mode 100644 codeforces/PrimeOrNot/PrimeOrNot.cpp create mode 100644 codeforces/QueueAtTheSchool/inp create mode 100755 codeforces/QueueAtTheSchool/main create mode 100644 codeforces/QueueAtTheSchool/main.cpp create mode 100644 codeforces/QueueAtTheSchool/main_input0.txt create mode 100644 codeforces/QueueAtTheSchool/main_input1.txt create mode 100644 codeforces/QueueAtTheSchool/main_input2.txt create mode 100644 codeforces/QueueAtTheSchool/main_output0.txt create mode 100644 codeforces/QueueAtTheSchool/main_output1.txt create mode 100644 codeforces/QueueAtTheSchool/main_output2.txt create mode 100644 codeforces/SequenceEquation/SequenceEquation.cpp create mode 100644 codeforces/StonesOnTheTable/inp create mode 100755 codeforces/StonesOnTheTable/main create mode 100644 codeforces/StonesOnTheTable/main.cpp create mode 100644 codeforces/StonesOnTheTable/main_input0.txt create mode 100644 codeforces/StonesOnTheTable/main_input1.txt create mode 100644 codeforces/StonesOnTheTable/main_input2.txt create mode 100644 codeforces/StonesOnTheTable/main_output0.txt create mode 100644 codeforces/StonesOnTheTable/main_output1.txt create mode 100644 codeforces/StonesOnTheTable/main_output2.txt create mode 100644 codeforces/StringTask/StringTask.cpp create mode 100644 codeforces/SumsOfSubSequence/SumsOfSubSequence.cpp create mode 100644 codeforces/TakeDiscountOrNot/TakeDiscountOrNot.cpp create mode 100644 codeforces/ThePowerSum/ThePowerSum.cpp create mode 100755 codeforces/TheThirdThreeNumberProblem/main create mode 100644 codeforces/TheThirdThreeNumberProblem/main.cpp create mode 100644 codeforces/TheThirdThreeNumberProblem/main_input0.txt create mode 100644 codeforces/TheThirdThreeNumberProblem/main_output0.txt create mode 100755 codeforces/ThreeDoors/main create mode 100644 codeforces/ThreeDoors/main.cpp create mode 100644 codeforces/ThreeDoors/main_input0.txt create mode 100644 codeforces/ThreeDoors/main_output0.txt create mode 100644 codeforces/TokitsukazeAndAllZeroSequence/TokitsukazeAndAllZeroSequence.cpp create mode 100644 codeforces/UltraFastMathmatician/inp create mode 100755 codeforces/UltraFastMathmatician/main create mode 100644 codeforces/UltraFastMathmatician/main.cpp create mode 100644 codeforces/UltraFastMathmatician/main_input0.txt create mode 100644 codeforces/UltraFastMathmatician/main_input1.txt create mode 100644 codeforces/UltraFastMathmatician/main_input2.txt create mode 100644 codeforces/UltraFastMathmatician/main_input3.txt create mode 100644 codeforces/UltraFastMathmatician/main_output0.txt create mode 100644 codeforces/UltraFastMathmatician/main_output1.txt create mode 100644 codeforces/UltraFastMathmatician/main_output2.txt create mode 100644 codeforces/UltraFastMathmatician/main_output3.txt create mode 100644 codeforces/Word/inp create mode 100755 codeforces/Word/main create mode 100644 codeforces/Word/main.cpp create mode 100644 codeforces/Word/main_input0.txt create mode 100644 codeforces/Word/main_input1.txt create mode 100644 codeforces/Word/main_input2.txt create mode 100644 codeforces/Word/main_output0.txt create mode 100644 codeforces/Word/main_output1.txt create mode 100644 codeforces/Word/main_output2.txt create mode 100644 codeforces/WordCapitalization/inp create mode 100755 codeforces/WordCapitalization/main create mode 100644 codeforces/WordCapitalization/main.cpp create mode 100644 codeforces/WordCapitalization/main_input0.txt create mode 100644 codeforces/WordCapitalization/main_input1.txt create mode 100644 codeforces/WordCapitalization/main_output0.txt create mode 100644 codeforces/WordCapitalization/main_output1.txt create mode 100755 codeforces/WorkingWeek/main create mode 100644 codeforces/WorkingWeek/main.cpp create mode 100644 codeforces/WorkingWeek/main_input0.txt create mode 100644 codeforces/WorkingWeek/main_output0.txt create mode 100644 codeforces/YoungPhysicist/YoungPhysicist.cpp create mode 100644 codeforces/beatTheOdds/inp create mode 100755 codeforces/beatTheOdds/main create mode 100644 codeforces/beatTheOdds/main.cpp create mode 100644 codeforces/chocolateFeast/chocolateFeast.cpp create mode 100644 codeforces/chocolateFeastRevised/chocolateFeastRevised.cpp create mode 100755 codeforces/closestToTheLeft/main create mode 100644 codeforces/closestToTheLeft/main.cpp create mode 100644 codeforces/closestToTheLeft/main_input0.txt create mode 100644 codeforces/closestToTheLeft/main_output0.txt create mode 100755 codeforces/cubesShuffling/main create mode 100644 codeforces/cubesShuffling/main.cpp create mode 100644 codeforces/cubesShuffling/main_input0.txt create mode 100644 codeforces/cubesShuffling/main_output0.txt create mode 100644 codeforces/cutTheSticks/cutTheSticks.cpp create mode 100644 codeforces/cutTheSticksJoe/cutTheSticksJoe.cpp create mode 100644 codeforces/cutTheSticksRevised/cutTheSticksRevised.cpp create mode 100755 codeforces/doubleStrings/main create mode 100644 codeforces/doubleStrings/main.cpp create mode 100644 codeforces/doubleStrings/main_input0.txt create mode 100644 codeforces/doubleStrings/main_output0.txt create mode 100755 codeforces/fastSearch/main create mode 100644 codeforces/fastSearch/main.cpp create mode 100644 codeforces/fastSearch/main_input0.txt create mode 100644 codeforces/fastSearch/main_output0.txt create mode 100644 codeforces/iceCreamParlor/iceCreamParlor.cpp create mode 100755 codeforces/icpcBallons/main create mode 100644 codeforces/icpcBallons/main.cpp create mode 100644 codeforces/icpcBallons/main_input0.txt create mode 100644 codeforces/icpcBallons/main_output0.txt create mode 100644 codeforces/recursionTest/recursionTest.cpp create mode 100755 codeforces/strangeAddition/main create mode 100644 codeforces/strangeAddition/main.cpp create mode 100644 codeforces/strangeAddition/main_input0.txt create mode 100644 codeforces/strangeAddition/main_input1.txt create mode 100644 codeforces/strangeAddition/main_output0.txt create mode 100644 codeforces/strangeAddition/main_output1.txt create mode 100755 codeforces/yapapsai/main create mode 100644 codeforces/yapapsai/main.cpp create mode 100644 codeforces/yapapsai/main_input0.txt create mode 100644 codeforces/yapapsai/main_output0.txt create mode 100755 codeforces/yesOrYes/main create mode 100644 codeforces/yesOrYes/main.cpp create mode 100644 codeforces/yesOrYes/main_input0.txt create mode 100644 codeforces/yesOrYes/main_output0.txt create mode 100755 contests/filtrationContest/A/main create mode 100644 contests/filtrationContest/A/main.cpp create mode 100644 contests/filtrationContest/A/main_input0.txt create mode 100644 contests/filtrationContest/A/main_output0.txt create mode 100755 contests/filtrationContest/B/main create mode 100644 contests/filtrationContest/B/main.cpp create mode 100644 contests/filtrationContest/B/main_input0.txt create mode 100644 contests/filtrationContest/B/main_output0.txt create mode 100755 contests/filtrationContest/C/main create mode 100644 contests/filtrationContest/C/main.cpp create mode 100644 contests/filtrationContest/C/main_input0.txt create mode 100644 contests/filtrationContest/C/main_input1.txt create mode 100644 contests/filtrationContest/C/main_input2.txt create mode 100644 contests/filtrationContest/C/main_input3.txt create mode 100644 contests/filtrationContest/C/main_input4.txt create mode 100644 contests/filtrationContest/C/main_input5.txt create mode 100644 contests/filtrationContest/C/main_output0.txt create mode 100644 contests/filtrationContest/C/main_output1.txt create mode 100644 contests/filtrationContest/C/main_output2.txt create mode 100644 contests/filtrationContest/C/main_output3.txt create mode 100644 contests/filtrationContest/C/main_output4.txt create mode 100644 contests/filtrationContest/C/main_output5.txt create mode 100644 contests/filtrationContest/D/main.cpp create mode 100644 contests/filtrationContest/F/main.cpp create mode 100755 contests/filtrationContest/G/main create mode 100644 contests/filtrationContest/G/main.cpp create mode 100644 contests/filtrationContest/G/main_input0.txt create mode 100644 contests/filtrationContest/G/main_output0.txt create mode 100755 contests/filtrationContest/H/main create mode 100644 contests/filtrationContest/H/main.cpp create mode 100644 contests/filtrationContest/H/main_input0.txt create mode 100644 contests/filtrationContest/H/main_output0.txt create mode 100755 contests/filtrationContest/I/main create mode 100644 contests/filtrationContest/I/main.cpp create mode 100644 contests/filtrationContest/I/main_input0.txt create mode 100644 contests/filtrationContest/I/main_input1.txt create mode 100644 contests/filtrationContest/I/main_input2.txt create mode 100644 contests/filtrationContest/I/main_input3.txt create mode 100644 contests/filtrationContest/I/main_input4.txt create mode 100644 contests/filtrationContest/I/main_output0.txt create mode 100644 contests/filtrationContest/I/main_output1.txt create mode 100644 contests/filtrationContest/I/main_output2.txt create mode 100644 contests/filtrationContest/I/main_output3.txt create mode 100644 contests/filtrationContest/I/main_output4.txt create mode 100755 contests/filtrationContest/J/main create mode 100644 contests/filtrationContest/J/main.cpp create mode 100644 contests/filtrationContest/J/main_input0.txt create mode 100644 contests/filtrationContest/J/main_input1.txt create mode 100644 contests/filtrationContest/J/main_input2.txt create mode 100644 contests/filtrationContest/J/main_input3.txt create mode 100644 contests/filtrationContest/J/main_output0.txt create mode 100644 contests/filtrationContest/J/main_output1.txt create mode 100644 contests/filtrationContest/J/main_output2.txt create mode 100644 contests/filtrationContest/J/main_output3.txt create mode 100644 contests/testcont/A/main.cpp create mode 100644 contests/testcont/B/main.cpp create mode 100644 contests/testcont/C/main.cpp create mode 100644 contests/testcont/D/main.cpp create mode 100644 contests/testcont/E/main.cpp create mode 100644 contests/testcont/F/main.cpp create mode 100644 cses/SortingAndSearching/Apartments/main.cpp create mode 100755 cses/SortingAndSearching/SumOfTwoValues/main create mode 100644 cses/SortingAndSearching/SumOfTwoValues/main.cpp create mode 100644 cses/SortingAndSearching/SumOfTwoValues/main_input0.txt create mode 100644 cses/SortingAndSearching/SumOfTwoValues/main_input1.txt create mode 100644 cses/SortingAndSearching/SumOfTwoValues/main_output0.txt create mode 100644 cses/SortingAndSearching/SumOfTwoValues/main_output1.txt diff --git a/HackerRank/CountingSort1/CountingSort1.cpp b/HackerRank/CountingSort1/CountingSort1.cpp new file mode 100644 index 0000000..20b476a --- /dev/null +++ b/HackerRank/CountingSort1/CountingSort1.cpp @@ -0,0 +1,19 @@ +#include + +using namespace std; + +int main() { + int n, x; + cin >> n; + vector v; + vector freq(100); + for(int i = 0; i < n; i ++){ + cin >> x; + freq[x]+=1; + } + for(auto m : freq){ + cout << m << " "; + } + cout << endl; + return 0; +} diff --git a/HackerRank/CountingSort2/CountingSort2.cpp b/HackerRank/CountingSort2/CountingSort2.cpp new file mode 100644 index 0000000..29fb91c --- /dev/null +++ b/HackerRank/CountingSort2/CountingSort2.cpp @@ -0,0 +1,21 @@ +#include + +using namespace std; + +int main() { + int n, x; + cin >> n; + vector v; + vector freq(100); + for(int i = 0; i < n; i ++){ + cin >> x; + freq[x]+=1; + } + for(int i = 0; i < freq.size(); i++){ + for(int j = 0; j < freq[i]; j++){ + cout << i << " "; + } + } + cout << endl; + return 0; +} diff --git a/HackerRank/LonelyInteger/LonelyInteger.cpp b/HackerRank/LonelyInteger/LonelyInteger.cpp new file mode 100644 index 0000000..a5ce4a4 --- /dev/null +++ b/HackerRank/LonelyInteger/LonelyInteger.cpp @@ -0,0 +1,12 @@ +#include +using namespace std; +int main(){ + int n, x = 0, k; + cin >> n; + for(int i = 0; i < n; i++){ + cin >> k; + x ^= k; + } + cout << x; + return 0; +} diff --git a/HackerRank/Luck_balance/Luck_balance.cpp b/HackerRank/Luck_balance/Luck_balance.cpp new file mode 100644 index 0000000..403b53f --- /dev/null +++ b/HackerRank/Luck_balance/Luck_balance.cpp @@ -0,0 +1,37 @@ +#include +using namespace std; +bool comparePair(pair p1, pair p2){ + if(p1.second >= p2.second && p1.first > p2.first){ + return true; + } + else { + return false; + } +} + +int main() { + int n, k, sum = 0, cn=0; + cin >> n >> k; + vector> vp(n); + for(auto &x : vp){ + cin >> x.first >> x.second; + } + sort(vp.begin(), vp.end(), comparePair); + cout << "-----------------------------------"; + cout << endl; + for(auto x : vp){ + cout << x.first << " " << x.second << endl; + } + for(int i = 0; i < n; i++){ + if(vp[i].second == 1){ + cn++; + } + if(cn != k - 1){ + cout << "vp[" << i << "]" << vp[i].first << endl; + sum+=vp[i].first; + } + } + sum -= vp[cn].first; + cout << sum << endl; + return 0; +} diff --git a/codeforces/AlmostTernaryMatrix/main b/codeforces/AlmostTernaryMatrix/main new file mode 100755 index 0000000..e0e1fa7 Binary files /dev/null and b/codeforces/AlmostTernaryMatrix/main differ diff --git a/codeforces/AlmostTernaryMatrix/main.cpp b/codeforces/AlmostTernaryMatrix/main.cpp new file mode 100644 index 0000000..b12f974 --- /dev/null +++ b/codeforces/AlmostTernaryMatrix/main.cpp @@ -0,0 +1,20 @@ +#include + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int tt; + cin >> tt; + while(tt--){ + int n, m; + cin >> n >> m; + for(int i = 0; i < n; i++) { + for(int j = 0; j < m; j++) { + cout << ((((i + 1) / 2 + (j + 1) / 2)) % 2) << " "; + } + cout << '\n'; + } + } +} diff --git a/codeforces/AlmostTernaryMatrix/main_input0.txt b/codeforces/AlmostTernaryMatrix/main_input0.txt new file mode 100644 index 0000000..1cb1a53 --- /dev/null +++ b/codeforces/AlmostTernaryMatrix/main_input0.txt @@ -0,0 +1,4 @@ +3 +2 4 +2 2 +4 4 diff --git a/codeforces/AlmostTernaryMatrix/main_input1.txt b/codeforces/AlmostTernaryMatrix/main_input1.txt new file mode 100644 index 0000000..1c253ac --- /dev/null +++ b/codeforces/AlmostTernaryMatrix/main_input1.txt @@ -0,0 +1,2 @@ +1 +8 8 \ No newline at end of file diff --git a/codeforces/AlmostTernaryMatrix/main_output0.txt b/codeforces/AlmostTernaryMatrix/main_output0.txt new file mode 100644 index 0000000..8231c12 --- /dev/null +++ b/codeforces/AlmostTernaryMatrix/main_output0.txt @@ -0,0 +1,8 @@ +1 0 0 1 +0 1 1 0 +1 0 +0 1 +1 0 1 0 +0 0 1 1 +1 1 0 0 +0 1 0 1 diff --git a/codeforces/ArrivalOfTheGeneral/inp b/codeforces/ArrivalOfTheGeneral/inp new file mode 100644 index 0000000..e69de29 diff --git a/codeforces/ArrivalOfTheGeneral/main b/codeforces/ArrivalOfTheGeneral/main new file mode 100755 index 0000000..f0a7f85 Binary files /dev/null and b/codeforces/ArrivalOfTheGeneral/main differ diff --git a/codeforces/ArrivalOfTheGeneral/main.cpp b/codeforces/ArrivalOfTheGeneral/main.cpp new file mode 100644 index 0000000..95e6aa9 --- /dev/null +++ b/codeforces/ArrivalOfTheGeneral/main.cpp @@ -0,0 +1,27 @@ +#include + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int n; + cin >> n; + vector v(n); + int mx = 0; + int mn = 1e9; + for(int &x : v) { + cin >> x; + mx = max(mx, x); + mn = min(mn, x); + } + int imn = n - (find(v.rbegin(), v.rend(), mn) - v.rbegin()) - 1; + int imx = find(v.begin(), v.end(), mx) - v.begin(); + int x = n - imn - 1; + if(imx > imn) { + cout << imx + x - 1 << endl; + } else { + cout << imx + x << endl; + } + +} diff --git a/codeforces/ArrivalOfTheGeneral/main_input0.txt b/codeforces/ArrivalOfTheGeneral/main_input0.txt new file mode 100644 index 0000000..a48c99c --- /dev/null +++ b/codeforces/ArrivalOfTheGeneral/main_input0.txt @@ -0,0 +1,2 @@ +4 +33 44 11 22 diff --git a/codeforces/ArrivalOfTheGeneral/main_input1.txt b/codeforces/ArrivalOfTheGeneral/main_input1.txt new file mode 100644 index 0000000..87750bb --- /dev/null +++ b/codeforces/ArrivalOfTheGeneral/main_input1.txt @@ -0,0 +1,2 @@ +7 +10 10 58 31 63 40 76 diff --git a/codeforces/ArrivalOfTheGeneral/main_output0.txt b/codeforces/ArrivalOfTheGeneral/main_output0.txt new file mode 100644 index 0000000..0cfbf08 --- /dev/null +++ b/codeforces/ArrivalOfTheGeneral/main_output0.txt @@ -0,0 +1 @@ +2 diff --git a/codeforces/ArrivalOfTheGeneral/main_output1.txt b/codeforces/ArrivalOfTheGeneral/main_output1.txt new file mode 100644 index 0000000..f599e28 --- /dev/null +++ b/codeforces/ArrivalOfTheGeneral/main_output1.txt @@ -0,0 +1 @@ +10 diff --git a/codeforces/AvtoBus/AvtoBus.cpp b/codeforces/AvtoBus/AvtoBus.cpp new file mode 100644 index 0000000..615b1e7 --- /dev/null +++ b/codeforces/AvtoBus/AvtoBus.cpp @@ -0,0 +1,16 @@ +#include +using namespace std; +int main() { + int tt; + cin >> tt; + while(tt--) { + long long x; + cin >> x; + vector v; + if(x % 2 != 0 || x == 2) { + cout << "-1" << endl; + continue; + } + cout << ((x + 5) / 6) << " " << x / 4 << endl; + } +} diff --git a/codeforces/BeautifulMatrix/inp b/codeforces/BeautifulMatrix/inp new file mode 100644 index 0000000..e69de29 diff --git a/codeforces/BeautifulMatrix/main b/codeforces/BeautifulMatrix/main new file mode 100755 index 0000000..fd8f12e Binary files /dev/null and b/codeforces/BeautifulMatrix/main differ diff --git a/codeforces/BeautifulMatrix/main.cpp b/codeforces/BeautifulMatrix/main.cpp new file mode 100644 index 0000000..9fd86a8 --- /dev/null +++ b/codeforces/BeautifulMatrix/main.cpp @@ -0,0 +1,20 @@ +#include + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int x; + pair p; + for(int i = 1; i <= 5; i++) { + for(int j = 1; j <= 5; j++) { + cin >> x; + if(x) { + p.first = i; + p.second = j; + } + } + } + cout << abs(p.first - 3) + abs(p.second - 3); +} diff --git a/codeforces/BeautifulMatrix/main_input0.txt b/codeforces/BeautifulMatrix/main_input0.txt new file mode 100644 index 0000000..3f957a7 --- /dev/null +++ b/codeforces/BeautifulMatrix/main_input0.txt @@ -0,0 +1,5 @@ +0 0 0 0 0 +0 0 0 0 1 +0 0 0 0 0 +0 0 0 0 0 +0 0 0 0 0 diff --git a/codeforces/BeautifulMatrix/main_input1.txt b/codeforces/BeautifulMatrix/main_input1.txt new file mode 100644 index 0000000..09c3945 --- /dev/null +++ b/codeforces/BeautifulMatrix/main_input1.txt @@ -0,0 +1,5 @@ +0 0 0 0 0 +0 0 0 0 0 +0 1 0 0 0 +0 0 0 0 0 +0 0 0 0 0 diff --git a/codeforces/BeautifulMatrix/main_output0.txt b/codeforces/BeautifulMatrix/main_output0.txt new file mode 100644 index 0000000..00750ed --- /dev/null +++ b/codeforces/BeautifulMatrix/main_output0.txt @@ -0,0 +1 @@ +3 diff --git a/codeforces/BeautifulMatrix/main_output1.txt b/codeforces/BeautifulMatrix/main_output1.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/codeforces/BeautifulMatrix/main_output1.txt @@ -0,0 +1 @@ +1 diff --git a/codeforces/BeautifulYear/inp b/codeforces/BeautifulYear/inp new file mode 100644 index 0000000..e69de29 diff --git a/codeforces/BeautifulYear/main b/codeforces/BeautifulYear/main new file mode 100755 index 0000000..ac627ae Binary files /dev/null and b/codeforces/BeautifulYear/main differ diff --git a/codeforces/BeautifulYear/main.cpp b/codeforces/BeautifulYear/main.cpp new file mode 100644 index 0000000..31fa32d --- /dev/null +++ b/codeforces/BeautifulYear/main.cpp @@ -0,0 +1,21 @@ +#include + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int in; + cin >> in; + for(int i = in + 1; i <= 9500; i++) { + string s = to_string(i); + set st; + for(auto ch : s) { + st.insert(ch - '0'); + } + if(st.size() == 4) { + cout << i << endl; + break; + } + } +} diff --git a/codeforces/BeautifulYear/main_input0.txt b/codeforces/BeautifulYear/main_input0.txt new file mode 100644 index 0000000..ef0a2ad --- /dev/null +++ b/codeforces/BeautifulYear/main_input0.txt @@ -0,0 +1 @@ +1987 diff --git a/codeforces/BeautifulYear/main_input1.txt b/codeforces/BeautifulYear/main_input1.txt new file mode 100644 index 0000000..e355f6d --- /dev/null +++ b/codeforces/BeautifulYear/main_input1.txt @@ -0,0 +1 @@ +2013 diff --git a/codeforces/BeautifulYear/main_output0.txt b/codeforces/BeautifulYear/main_output0.txt new file mode 100644 index 0000000..e355f6d --- /dev/null +++ b/codeforces/BeautifulYear/main_output0.txt @@ -0,0 +1 @@ +2013 diff --git a/codeforces/BeautifulYear/main_output1.txt b/codeforces/BeautifulYear/main_output1.txt new file mode 100644 index 0000000..9ebee8e --- /dev/null +++ b/codeforces/BeautifulYear/main_output1.txt @@ -0,0 +1 @@ +2014 diff --git a/codeforces/BinarySearch/main b/codeforces/BinarySearch/main new file mode 100755 index 0000000..fc015d6 Binary files /dev/null and b/codeforces/BinarySearch/main differ diff --git a/codeforces/BinarySearch/main.cpp b/codeforces/BinarySearch/main.cpp new file mode 100644 index 0000000..2dbe7fe --- /dev/null +++ b/codeforces/BinarySearch/main.cpp @@ -0,0 +1,38 @@ +#include + +using namespace std; + +bool bs(vector &a, int toFind) { + int low = 0; + int high = a.size() - 1; + int mid = (high + low) / 2; + while (low <= high) { + if (a[mid] == toFind) { + return true; + } else if (a[mid] > toFind) { + high = mid - 1; + } else if(a[mid] < toFind){ + low = mid + 1; + } + mid = (high + low) / 2; + } + return false; +} + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int n, k; + cin >> n >> k; + + vector a(n); + vector q(n); + + for (int &x : a) + cin >> x; + for (int i = 0; i < k; i++) { + int y; + cin >> y; + cout << (bs(a, y) ? "YES" : "NO") << endl; + } +} diff --git a/codeforces/BinarySearch/main_input0.txt b/codeforces/BinarySearch/main_input0.txt new file mode 100644 index 0000000..0b33549 --- /dev/null +++ b/codeforces/BinarySearch/main_input0.txt @@ -0,0 +1,3 @@ +10 10 +1 61 126 217 2876 6127 39162 98126 712687 1000000000 +100 6127 1 61 200 -10000 1 217 10000 1000000000 diff --git a/codeforces/BinarySearch/main_output0.txt b/codeforces/BinarySearch/main_output0.txt new file mode 100644 index 0000000..9b9d3c3 --- /dev/null +++ b/codeforces/BinarySearch/main_output0.txt @@ -0,0 +1,10 @@ +NO +YES +YES +YES +NO +NO +YES +YES +NO +YES diff --git a/codeforces/Borze/inp b/codeforces/Borze/inp new file mode 100644 index 0000000..e69de29 diff --git a/codeforces/Borze/main b/codeforces/Borze/main new file mode 100755 index 0000000..d6bf512 Binary files /dev/null and b/codeforces/Borze/main differ diff --git a/codeforces/Borze/main.cpp b/codeforces/Borze/main.cpp new file mode 100644 index 0000000..b35852f --- /dev/null +++ b/codeforces/Borze/main.cpp @@ -0,0 +1,14 @@ +#include + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + string s; + cin >> s; + s = regex_replace(s, regex("--"), "2"); + s = regex_replace(s, regex("-\\."), "1"); + s = regex_replace(s, regex("\\."), "0"); + cout << s << endl; +} diff --git a/codeforces/Borze/main_input0.txt b/codeforces/Borze/main_input0.txt new file mode 100644 index 0000000..0685e8c --- /dev/null +++ b/codeforces/Borze/main_input0.txt @@ -0,0 +1 @@ +.-.-- diff --git a/codeforces/Borze/main_input1.txt b/codeforces/Borze/main_input1.txt new file mode 100644 index 0000000..7bb3b93 --- /dev/null +++ b/codeforces/Borze/main_input1.txt @@ -0,0 +1 @@ +--. diff --git a/codeforces/Borze/main_input2.txt b/codeforces/Borze/main_input2.txt new file mode 100644 index 0000000..c8b3186 --- /dev/null +++ b/codeforces/Borze/main_input2.txt @@ -0,0 +1 @@ +-..-.-- diff --git a/codeforces/Borze/main_output0.txt b/codeforces/Borze/main_output0.txt new file mode 100644 index 0000000..de97a6d --- /dev/null +++ b/codeforces/Borze/main_output0.txt @@ -0,0 +1 @@ +012 diff --git a/codeforces/Borze/main_output1.txt b/codeforces/Borze/main_output1.txt new file mode 100644 index 0000000..209e3ef --- /dev/null +++ b/codeforces/Borze/main_output1.txt @@ -0,0 +1 @@ +20 diff --git a/codeforces/Borze/main_output2.txt b/codeforces/Borze/main_output2.txt new file mode 100644 index 0000000..2d1420d --- /dev/null +++ b/codeforces/Borze/main_output2.txt @@ -0,0 +1 @@ +1012 diff --git a/codeforces/BoyOrGirl/BoyOrGirl.cpp b/codeforces/BoyOrGirl/BoyOrGirl.cpp new file mode 100644 index 0000000..1ce7fff --- /dev/null +++ b/codeforces/BoyOrGirl/BoyOrGirl.cpp @@ -0,0 +1,12 @@ +#include +using namespace std; +int main() { + string s; + cin >> s; + set st; + for(auto ch : s) { + st.insert(ch); + } + cout << (st.size() % 2 != 0 ? "IGNORE HIM!" : "CHAT WITH HER!") << endl; +} + diff --git a/codeforces/CamelCase/CamelCase.cpp b/codeforces/CamelCase/CamelCase.cpp new file mode 100644 index 0000000..bbcef3a --- /dev/null +++ b/codeforces/CamelCase/CamelCase.cpp @@ -0,0 +1,16 @@ +#include + +using namespace std; + +int main() { + string s; + int count = 0; + cin >> s; + for(auto ch : s) { + if(isupper(ch)) { + count++; + } + } + cout << count + 1 << '\n'; + return 0; +} diff --git a/codeforces/ConsecutivePointsSegment/ConsecutivePointsSegment.cpp b/codeforces/ConsecutivePointsSegment/ConsecutivePointsSegment.cpp new file mode 100644 index 0000000..f0d2b4c --- /dev/null +++ b/codeforces/ConsecutivePointsSegment/ConsecutivePointsSegment.cpp @@ -0,0 +1,31 @@ +#include +using namespace std; +int main() { + int tt; + cin >> tt; + while(tt--) { + int n; + int gapSize = 0; + int gap = 0; + cin >> n; + vector v(n); + for(int& x : v) cin >> x; + for(int i = 0; i < n - 1; i++) { + if(v[i+1] - v[i] > 1) { + gapSize += v[i+1] - v[i]; + gap++; + } + } + if(gap > 2) { + cout << "NO" << endl; + } else { + if(gapSize >= 5 && gap == 2) { + cout << "NO" << endl; + } else if(gap == 1 && gapSize >= 4){ + cout << "NO" << endl; + } else { + cout << "YES" << endl; + } + } + } +} diff --git a/codeforces/Diagonal_Difference/Diagonal_Difference.cpp b/codeforces/Diagonal_Difference/Diagonal_Difference.cpp new file mode 100644 index 0000000..cb7c2f2 --- /dev/null +++ b/codeforces/Diagonal_Difference/Diagonal_Difference.cpp @@ -0,0 +1,30 @@ +#include + +using namespace std; + +int main(){ + int n; + cin >> n; + vector v1(n); + vector> v2; + for(int i = 0; i < n; i++){ + for(auto &x : v1){ + cin >> x; + cout << "x: " << x << endl; + } + v2.push_back(v1); + } + int dg1 = 0, dg2 = 0; + for(int i = 0; i < n; i++){ + dg1+=v2[i][i]; + } + for(int i = 0; i < n; i++){ + dg2+=v2[i][n-i-1]; + } + cout << abs(dg2 - dg1) << endl; + + + return 0; + +} + diff --git a/codeforces/Dictionary/Dictionary.cpp b/codeforces/Dictionary/Dictionary.cpp new file mode 100644 index 0000000..e74018a --- /dev/null +++ b/codeforces/Dictionary/Dictionary.cpp @@ -0,0 +1,22 @@ +#include + +using namespace std; + +int solve(char c1, char c2, string letters) { + int c1Pos = letters.find(c1); + letters.erase(remove(letters.begin(), letters.end(), c1), letters.end()); + int c2Pos = letters.find(c2) + 1; + return (c1Pos * 25 + c2Pos); +} + +int main() { + string letters = "abcdefghijklmnopqrstuvwxyz"; + int tt; + cin >> tt; + while (tt--) { + char c1, c2; + cin >> c1 >> c2; + cout << solve(c1, c2, letters) << endl; + } + return 0; +} diff --git a/codeforces/DifferenceOperations/main b/codeforces/DifferenceOperations/main new file mode 100755 index 0000000..808f4b1 Binary files /dev/null and b/codeforces/DifferenceOperations/main differ diff --git a/codeforces/DifferenceOperations/main.cpp b/codeforces/DifferenceOperations/main.cpp new file mode 100644 index 0000000..7594a5c --- /dev/null +++ b/codeforces/DifferenceOperations/main.cpp @@ -0,0 +1,23 @@ +#include + +using namespace std; + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int tt; + cin >> tt; + while (tt--) { + int n; + cin >> n; + vector v(n); + for (int &x : v) + cin >> x; + bool ok = true; + for (int i = 1; i < n; ++i) { + if (v[i] % v[0]) + ok = false; + } + cout << (ok ? "YES" : "NO") << endl; + } +} diff --git a/codeforces/DifferenceOperations/main_input0.txt b/codeforces/DifferenceOperations/main_input0.txt new file mode 100644 index 0000000..a34da86 --- /dev/null +++ b/codeforces/DifferenceOperations/main_input0.txt @@ -0,0 +1,9 @@ +4 +2 +5 10 +3 +1 2 3 +4 +1 1 1 1 +9 +9 9 8 2 4 4 3 5 3 diff --git a/codeforces/DifferenceOperations/main_input1.txt b/codeforces/DifferenceOperations/main_input1.txt new file mode 100644 index 0000000..984e61f --- /dev/null +++ b/codeforces/DifferenceOperations/main_input1.txt @@ -0,0 +1,3 @@ +1 +3 +1 1 2 \ No newline at end of file diff --git a/codeforces/DifferenceOperations/main_input2.txt b/codeforces/DifferenceOperations/main_input2.txt new file mode 100644 index 0000000..55ea267 --- /dev/null +++ b/codeforces/DifferenceOperations/main_input2.txt @@ -0,0 +1,105 @@ +52 +2 +1 1 +3 +1 1 1 +3 +1 1 2 +3 +1 1 3 +3 +1 1 4 +3 +1 1 5 +2 +1 2 +3 +1 2 1 +3 +1 2 2 +3 +1 2 3 +3 +1 2 4 +3 +1 2 5 +2 +1 3 +3 +1 3 1 +3 +1 3 2 +3 +1 3 3 +3 +1 3 4 +3 +1 3 5 +2 +1 4 +3 +1 4 1 +3 +1 4 2 +3 +1 4 3 +3 +1 4 4 +3 +1 4 5 +2 +1 5 +3 +1 5 1 +3 +1 5 2 +3 +1 5 3 +3 +1 5 4 +3 +1 5 5 +2 +2 1 +3 +2 1 1 +3 +2 1 2 +3 +2 1 3 +3 +2 1 4 +3 +2 1 5 +2 +2 2 +3 +2 2 1 +3 +2 2 2 +3 +2 2 3 +3 +2 2 4 +3 +2 2 5 +2 +2 3 +3 +2 3 1 +3 +2 3 2 +3 +2 3 3 +3 +2 3 4 +3 +2 3 5 +2 +2 4 +3 +2 4 1 +3 +2 4 2 +3 +2 4 3 \ No newline at end of file diff --git a/codeforces/DifferenceOperations/main_input3.txt b/codeforces/DifferenceOperations/main_input3.txt new file mode 100644 index 0000000..fe89f7c --- /dev/null +++ b/codeforces/DifferenceOperations/main_input3.txt @@ -0,0 +1,153 @@ +76 +9 +52 65 14 59 16 52 62 71 90 +8 +66 88 27 98 28 49 48 50 +3 +24 57 99 +7 +51 43 76 90 36 61 97 +9 +86 23 91 42 57 79 38 30 31 +4 +77 10 84 76 +9 +48 89 76 43 47 57 51 71 23 +5 +63 56 17 89 16 +2 +33 45 +4 +34 64 63 48 +10 +92 88 59 78 84 34 64 64 55 61 +4 +52 43 84 43 +9 +13 39 57 62 35 59 10 60 1 +9 +84 89 30 55 33 56 4 18 64 +4 +24 17 78 2 +4 +85 40 7 67 +2 +84 92 +7 +100 3 36 17 46 28 82 +9 +38 2 45 28 32 50 18 92 18 +2 +1 41 +10 +62 85 34 100 40 54 88 31 77 4 +2 +95 86 +2 +72 36 +9 +24 5 98 3 7 22 15 45 67 +3 +22 71 85 +8 +81 51 59 59 89 99 87 18 +10 +5 89 7 19 62 8 31 24 9 86 +10 +1 46 77 90 71 38 34 23 58 10 +3 +60 71 84 +4 +11 16 30 33 +6 +87 91 35 39 4 22 +8 +70 30 39 53 19 23 54 17 +8 +10 95 25 95 20 34 52 11 +9 +74 49 64 24 21 76 63 81 35 +10 +4 64 83 21 85 77 60 65 94 74 +7 +88 53 39 2 29 93 80 +5 +73 3 99 31 10 +8 +54 90 58 48 2 12 16 81 +2 +5 29 +5 +15 97 35 49 7 +10 +9 13 35 59 85 12 26 35 28 81 +10 +15 77 48 56 43 49 68 37 7 37 +2 +76 87 +7 +72 62 21 12 69 42 76 +6 +55 40 45 91 33 25 +10 +71 67 50 78 13 85 90 45 33 51 +7 +81 64 62 88 48 100 82 +10 +45 16 64 85 7 79 18 81 52 95 +6 +84 49 36 20 32 69 +4 +16 47 28 48 +7 +24 93 53 31 78 64 90 +7 +84 68 92 53 8 94 53 +8 +38 54 83 10 80 69 32 25 +8 +17 64 28 81 52 94 85 39 +2 +29 97 +6 +85 26 1 7 75 67 +10 +17 7 11 74 28 44 89 13 69 87 +8 +32 98 15 73 26 32 90 43 +6 +36 88 84 10 60 22 +6 +40 6 26 61 87 85 +9 +95 44 35 39 1 43 16 44 49 +2 +43 98 +3 +6 38 12 +2 +29 96 +4 +52 66 58 66 +2 +61 92 +2 +16 74 +6 +78 53 79 80 99 63 +9 +64 66 71 28 73 4 72 1 61 +9 +27 22 52 20 95 70 69 66 25 +7 +27 86 37 20 48 53 77 +8 +40 92 63 33 91 23 94 37 +3 +17 21 9 +10 +1 30 17 6 12 75 63 71 3 70 +6 +65 74 6 41 10 6 +7 +51 70 8 94 100 64 8 diff --git a/codeforces/DifferenceOperations/main_output0.txt b/codeforces/DifferenceOperations/main_output0.txt new file mode 100644 index 0000000..4d34574 --- /dev/null +++ b/codeforces/DifferenceOperations/main_output0.txt @@ -0,0 +1,4 @@ +YES +YES +YES +NO diff --git a/codeforces/DifferenceOperations/main_output1.txt b/codeforces/DifferenceOperations/main_output1.txt new file mode 100644 index 0000000..d2bb323 --- /dev/null +++ b/codeforces/DifferenceOperations/main_output1.txt @@ -0,0 +1 @@ +YES \ No newline at end of file diff --git a/codeforces/DifferenceOperations/main_output2.txt b/codeforces/DifferenceOperations/main_output2.txt new file mode 100644 index 0000000..a31ba10 --- /dev/null +++ b/codeforces/DifferenceOperations/main_output2.txt @@ -0,0 +1,52 @@ +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +YES +NO +YES +NO +YES +NO +YES +YES +YES +YES +YES +YES +YES +NO +YES +NO \ No newline at end of file diff --git a/codeforces/DifferenceOperations/randomInput.txt b/codeforces/DifferenceOperations/randomInput.txt new file mode 100644 index 0000000..44573bc --- /dev/null +++ b/codeforces/DifferenceOperations/randomInput.txt @@ -0,0 +1,154 @@ +76 +9 +52 65 14 59 16 52 62 71 90 +8 +66 88 27 98 28 49 48 50 +3 +24 57 99 +7 +51 43 76 90 36 61 97 +9 +86 23 91 42 57 79 38 30 31 +4 +77 10 84 76 +9 +48 89 76 43 47 57 51 71 23 +5 +63 56 17 89 16 +2 +33 45 +4 +34 64 63 48 +10 +92 88 59 78 84 34 64 64 55 61 +4 +52 43 84 43 +9 +13 39 57 62 35 59 10 60 1 +9 +84 89 30 55 33 56 4 18 64 +4 +24 17 78 2 +4 +85 40 7 67 +2 +84 92 +7 +100 3 36 17 46 28 82 +9 +38 2 45 28 32 50 18 92 18 +2 +1 41 +10 +62 85 34 100 40 54 88 31 77 4 +2 +95 86 +2 +72 36 +9 +24 5 98 3 7 22 15 45 67 +3 +22 71 85 +8 +81 51 59 59 89 99 87 18 +10 +5 89 7 19 62 8 31 24 9 86 +10 +1 46 77 90 71 38 34 23 58 10 +3 +60 71 84 +4 +11 16 30 33 +6 +87 91 35 39 4 22 +8 +70 30 39 53 19 23 54 17 +8 +10 95 25 95 20 34 52 11 +9 +74 49 64 24 21 76 63 81 35 +10 +4 64 83 21 85 77 60 65 94 74 +7 +88 53 39 2 29 93 80 +5 +73 3 99 31 10 +8 +54 90 58 48 2 12 16 81 +2 +5 29 +5 +15 97 35 49 7 +10 +9 13 35 59 85 12 26 35 28 81 +10 +15 77 48 56 43 49 68 37 7 37 +2 +76 87 +7 +72 62 21 12 69 42 76 +6 +55 40 45 91 33 25 +10 +71 67 50 78 13 85 90 45 33 51 +7 +81 64 62 88 48 100 82 +10 +45 16 64 85 7 79 18 81 52 95 +6 +84 49 36 20 32 69 +4 +16 47 28 48 +7 +24 93 53 31 78 64 90 +7 +84 68 92 53 8 94 53 +8 +38 54 83 10 80 69 32 25 +8 +17 64 28 81 52 94 85 39 +2 +29 97 +6 +85 26 1 7 75 67 +10 +17 7 11 74 28 44 89 13 69 87 +8 +32 98 15 73 26 32 90 43 +6 +36 88 84 10 60 22 +6 +40 6 26 61 87 85 +9 +95 44 35 39 1 43 16 44 49 +2 +43 98 +3 +6 38 12 +2 +29 96 +4 +52 66 58 66 +2 +61 92 +2 +16 74 +6 +78 53 79 80 99 63 +9 +64 66 71 28 73 4 72 1 61 +9 +27 22 52 20 95 70 69 66 25 +7 +27 86 37 20 48 53 77 +8 +40 92 63 33 91 23 94 37 +3 +17 21 9 +10 +1 30 17 6 12 75 63 71 3 70 +6 +65 74 6 41 10 6 +7 +51 70 8 94 100 64 8 + diff --git a/codeforces/DiffucltyRatingOrder/DiffucltyRatingOrder.cpp b/codeforces/DiffucltyRatingOrder/DiffucltyRatingOrder.cpp new file mode 100644 index 0000000..1ed740d --- /dev/null +++ b/codeforces/DiffucltyRatingOrder/DiffucltyRatingOrder.cpp @@ -0,0 +1,23 @@ +#include +using namespace std; +bool isIncreasing(vector v) { + for(int i = 0; i < v.size() - 1; i++) { + if(v[i+1] < v[i]) { + return false; + } + } + return true; +} + + +int main() { + int tt; + cin >> tt; + while(tt--) { + int n; + cin >> n; + vector v(n); + for(int &x : v) cin >> x; + cout << (isIncreasing(v) ? "YES" : "NO") << '\n'; + } +} diff --git a/codeforces/DormsRoom/DormsRoom.cpp b/codeforces/DormsRoom/DormsRoom.cpp new file mode 100644 index 0000000..028ec8a --- /dev/null +++ b/codeforces/DormsRoom/DormsRoom.cpp @@ -0,0 +1,30 @@ +#include