Skip to content

Commit

Permalink
Added new question starters 26 section
Browse files Browse the repository at this point in the history
  • Loading branch information
KaranSiddhu committed Feb 19, 2022
1 parent c893049 commit 36392cc
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CP Contests/CodeChef/Starters 26/1. Car or Bus/code.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define ld long double

void solution(){
int x,y;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define ld long double

void solution(){
int n;
Expand Down
24 changes: 24 additions & 0 deletions CP Contests/CodeChef/Starters 26/3. Valentine is Coming/code.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define ld long double

void solution(){
int x, y;
cin >> x >> y;

cout << (x/y) << "\n";
}

int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);

int t;
cin >> t;
while(t--)
solution();

return 0;
}
36 changes: 36 additions & 0 deletions CP Contests/CodeChef/Starters 26/4. Hostel Room/code.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define ld long double

void solution(){
int n, x;
cin >> n >> x;

int arr[n];
for(int i = 0; i < n; i++)
cin >> arr[i];

int max = x;
for(int i = 0; i < n; i++){
x += arr[i];

if(x > max)
max = x;
}

cout<< max << "\n";
}

int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);

int t;
cin >> t;
while(t--)
solution();

return 0;
}

0 comments on commit 36392cc

Please sign in to comment.