-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new question starters 26 section
- Loading branch information
1 parent
c893049
commit 36392cc
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
CP Contests/CodeChef/Starters 26/2. Count the Notebooks/code.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
CP Contests/CodeChef/Starters 26/3. Valentine is Coming/code.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |