Skip to content

DVasios/Algorithmic-Tasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Algorithmic Tasks (C++)

This repository contains three algorithmic tasks implemented in C++ as part of the "Algorithms" course at the School of Electrical & Computer Engineering, National Technical University of Athens (NTUA).

Task 1: Statistical Alchemy (cereal)

Input

  • Number of Supermarkets: N
  • Minimum Number of Consecutive Supermarkets: K
  • Availability of Packages: Cn

Output

  • Maximum average value that can be achieved in a section of the main commercial road with at least k consecutive supermarket positions

Task 2: Shops with Christmas Items (shops)

Input

  • Number of houses: N
  • Number of houses we want to serve: K
  • Number of house residents: Pi

Output

  • An integer, the minimum total length of two non-overlapping consecutive residential intervals with a sum of residents equal to K. In case such intervals do not exist, the program should print -1

Task 3: Christmas Gift (salaries)

Input

  • Number of years: N
  • Maximum possible deviation from the real values: K
  • N non-negative integers p1, p2, ..., pN representing the average height of the Christmas tree for each of the last N years."

Output

  • Find a non-negative integer, which corresponds to the maximum length of the Longest Increasing Subsequence achievable from a modified sequence (q1, q2, ..., qN), where there exists an index range [l, r] and a value x, -K ≤ x ≤ K, such that qi = pi + x for every i ∈ [l, r], and qi = pi for every i ∉ [l, r].

About

Algorithmic Tasks in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published