Skip to content

Commit e614f11

Browse files
authored
Merge pull request #1 from Hackodex-ITER/master
Updating forked repo
2 parents 368d12f + eaa0a3a commit e614f11

File tree

370 files changed

+12106
-155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

370 files changed

+12106
-155
lines changed

CONTRIBUTING.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Contributing
2+
3+
## Instrutions to Contribute:
4+
5+
- First,go to [cses](https://cses.fi)
6+
7+
- Create a new account first & log in
8+
9+
- Then, go to [CSES Problem Set](https://cses.fi/problemset/)
10+
11+
- Choose any 5 questions of your choice and solve them
12+
13+
(Unique questions/language would be appreciated)
14+
15+
- To solve any particular question, click on it and then solve it first on your local IDE.
16+
17+
- Then upload that file (like missing_number.c or missing_number.java,etc.) from your local system in the submit section of that particular question.
18+
19+
- Once it successfully passes all the test cases
20+
21+
- fork [this] repo
22+
- Add question as comments at top & its link
23+
- Now add "author: cses id" as comment at the end of your program (e.g. - author: pritam047)
24+
- Example: Python Code
25+
```python
26+
# Print your Name
27+
# cses.fi/printName
28+
print('Ayush Kejariwal')
29+
# author: KejariwalAyush
30+
# profile: https://cses.fi/user/32415
31+
```
32+
- Rename that particular file here in the following format:
33+
- githubusername_problemname.fileformat (e.g. - pritam047_missing_number.c)
34+
- Make a folder of your Github Username & put above file in it (if already exists then add in it)
35+
- Add that folder into your stack(language e.g. java, python, etc) folder
36+
> example: master/java/KejariwalAyush/KejariwalAyush_missing_number.java
37+
- Now commit and push to your repo
38+
- And make a pull request to original repo
39+
40+
- Once we validate it, we shall accept your pull request.
41+
- While making Your Last Pull Request i.e., While making PR for 5th question add your Name in [CONTRIBUTORS.md](https://github.com/Hackodex-ITER/CSES-Problems/blob/master/CONTRIBUTORS.md)
42+
43+
**Note : Don't simply copy paste from others. Try to solve the problems on your own.**
44+
45+
### Example of passing test in cses
46+
47+
When you submit the answer to the question in [cses](https://cses.fi)
48+
49+
You should pass all tests, then only submit it here.
50+
51+
![Example](https://github.com/Hackodex-ITER/Hackodex-ITER/blob/master/example.jpg?raw=true)

CONTRIBUTORS.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# CONTRIBUTORS
2+
3+
## Add you Name in Contributors
4+
5+
These are the list of contributors to this project **who have completed 5 problems**.
6+
7+
- **Note: Make this changes with the last question PR or else your Hacktober Fest PR may get rejected**
8+
> ## How to edit it
9+
>
10+
> - Replace image with your github image by copying the image link
11+
`> <img src="github image link" width="50"> `
12+
> - then add your name & link of your Profile in given format in next line
13+
`[Name](https://github.com/UserName)`
14+
> - Final Code `> <img src="github image link" width="50"> [Name](https://github.com/UserName)`
15+
> - While making PR mention your name in it.
16+
>
17+
> #### NOTE: Before making PR make sure to check if everything is ok in preview section
18+
19+
# Main Contributors
20+
21+
### We have Completed 5 Problems
22+
23+
> <img src="https://avatars0.githubusercontent.com/u/53415956?s=460&u=36af1e2bed940f8d45769feef50cb564cec69c29&v=4" width="50"> [Ayush Kejariwal](https://github.com/KejariwalAyush/)
24+
25+
> <img src="https://avatars3.githubusercontent.com/u/53283341?s=460&u=ca203c1993d22c6ddc81914ab1d43a1ebe8f3586&v=4" width="50"> [Shruti Mallick](https://github.com/ShrutiMallick/)
26+
27+
> <img src="https://avatars0.githubusercontent.com/u/54541820?s=460&u=f502c71c7cd15ef5c6358835ba3729c83b2adc32&v=4" width="50"> [Ayush Kumar Sahoo](https://github.com/Ayushkumarsahoo)
28+
29+
> <img src="https://avatars3.githubusercontent.com/u/53616716?s=460&u=2fe91488e7a8f06888b4ba8e5e9b6ccefa7933e2&v=4" width="50"> [Suvam Pattnaik](https://github.com/Suvamrx)
30+
31+
> <img src="https://avatars2.githubusercontent.com/u/51512354?s=460&u=0346e1fd2505257e4416d80983147e7e56936c59&v=4" width="50"> [Debashish Samantara](https://github.com/debashishsamantara/)
32+
33+
> <img src="https://avatars1.githubusercontent.com/u/53290881?s=460&u=a4d8d99b68442ff8708fd19a890483394f9659a2&v=4" width="50"> [Abhishek Kumar](https://github.com/iamAbhishekkumar)
34+
35+
> <img src="https://avatars1.githubusercontent.com/u/53504602?s=460&u=5fc91194fc3c7ecac67567f1b106ec73c2f7a048&v=4" width="50"> [Sayantan Paul](https://github.com/belikesayantan)
36+
37+
> <img src="https://avatars3.githubusercontent.com/u/62745286?s=460&u=562f836c3c09b6d47ca7c6559b5b85c863d67383&v=4" width="50"> [Rituraj Gupta](https://github.com/rituraj-iter)
38+
39+
> <img src="https://avatars2.githubusercontent.com/u/53810519?s=460&u=c716c11e3e57faf13816af35ab6be152be1092b2&v=4" width="50"> [Sourav Bera](https://github.com/Zeo-shark)
40+
41+
> <img src="https://avatars3.githubusercontent.com/u/53331170?s=460&u=8c74d2b581da068bc247d2ec5d808012c94aa71e&v=4" width="50"> [Ravi Kumar Prasad](https://github.com/Raviruler)
42+
43+
> <img src="https://avatars3.githubusercontent.com/u/53517969?s=460&u=659d65b4f69c8a603b3ee32a7a1a676d9a815065&v=4" width="50"> [Rahul Kumar Jha](https://github.com/rahulkumarjha21)
44+
45+
> <img src="https://avatars0.githubusercontent.com/u/67056908?s=460&u=952c0a1bdea37923c88d3b02efdfc3857d6889fb&v=4" width="50"> [Suman More](https://github.com/SumanMore)
46+
47+
> <img src="https://avatars2.githubusercontent.com/u/35103134?s=400&u=da937d6e2d81bb61854db4ffcae7a32c62eca125&v=4" width="50"> [Nishant Choudhary](https://github.com/nishantc7)
48+
49+
> <img src="https://avatars2.githubusercontent.com/u/53290877?s=460&u=46ca1d4c64f4f7e9b44af379d4dba66b7784c31e&v=4" width="50"> [Saniya Ahuja](https://github.com/saniya3)
50+
51+
> <img src="https://avatars1.githubusercontent.com/u/42498830?s=400&u=cce64b9d85c17768315f9830b86ca6805e148b2e&v=4" width="50"> [TheSpeedX](https://github.com/TheSpeedX)
52+
53+
> <img src="https://avatars3.githubusercontent.com/u/54979627?s=460&u=c2aa86fadf778fd0f167b0f3d21f7ac9ac9c3927&v=4" width="50"> [Ankit Singh](https://github.com/ankitSaebby/)
54+
55+
> <img src="https://avatars3.githubusercontent.com/u/53535473?s=400&v=4" width="50"> [M.Akhilesh](https://github.com/AkhileshMattam)
56+
57+
> <img src="https://avatars0.githubusercontent.com/u/53302086?s=460&u=fd5d6f419d23698e507481c9bfe60fe6a4f2de5a&v=4" width="50">[Abhinandan Roul](https://github.com/AbhinandanRoul)
58+
59+
> <img src="https://avatars3.githubusercontent.com/u/66875383?s=460&v=4" width="50"> [Aaditya Mittal](https://github.com/aadityamittal)
60+
61+
> <img src="https://avatars1.githubusercontent.com/u/53518611?s=50&u=c4b5f332a1deb5c82049bf4709b7d767ce87a228&v=4" width="50"> [RIJULDAS](https://github.com/RIJULDAS)
62+
63+
> <img src="https://avatars3.githubusercontent.com/u/42297139?s=400&u=2f3162358f1bb3f73ba4465cc9bcdc8209180e89&v=4" width="50"> [SoumyaKB96](https://github.com/SoumyaKB96)
64+
65+
> <img src="https://avatars0.githubusercontent.com/u/53297570?s=460&v=4" width="50"> [Rishika Wadhera](https://github.com/Rishika6)
66+
67+
> <img src="https://avatars2.githubusercontent.com/u/53347922?s=460&u=b013f0df2d0660f0d4d73e6894cb97b742691e39&v=4" width="50"> [Tapas Sahu](https://github.com/Tapas14102000)
68+
69+
> <img src="https://avatars2.githubusercontent.com/u/53369178?s=50&u=5771461cdf37a59987901757d03e0b054a8488b3&v=4" width="50"> [Rohan Verma](https://github.com/MartyMiniac)
70+
71+
> <img src="https://avatars2.githubusercontent.com/u/54182748?s=400&u=033f6ff627c84c52db30c638a63f48aa5788ac73&v=4" width="50"> [Prakash Pathak](https://github.com/Prakashpathak984)
72+
73+
> <img src="https://avatars1.githubusercontent.com/u/53572957?s=400&u=8a71d277b1a0b1e423647aea047c6507e93640a6&v=4" width="50"> [Piyush Ranjan](https://github.com/itsPiyush01)
74+
75+
> <img src="https://avatars2.githubusercontent.com/u/53405743?s=400&u=2fc27198e07aefb45a87c604203e43dd777ade86&v=4" width="50"> [Satyapragyan Das](https://github.com/SatyapragyanDas)
76+
77+
> <img src="https://avatars0.githubusercontent.com/u/54390873?s=50&u=9d5f426d3b9484be68a485e0b0a9f122aff2c0e4&v=4" width="50"> [Kshitiz Ranjan](https://github.com/kshitizranjan15)
78+
79+
> <img src="https://avatars0.githubusercontent.com/u/53207299?s=460&u=fc6a1bc63de723c575b55174f269ce91cbe9ed8e&v=4" width="50"> [Tarique Nasar](https://github.com/NasarTarique)
80+
81+
> <img src="https://avatars1.githubusercontent.com/u/45062304?s=460&u=49d748b5c69f6361e559289b22e78ebb46bf8129&v=4" width="50"> [Ankita Satapathy](https://github.com/ankita-04/)
82+
83+
> <img src="https://avatars1.githubusercontent.com/u/66764663?s=460&u=c18aaa7dfe075fc37001cd8d7b58a05a9cb591f4&v=4" width="50"> [Abhishek Bannerjee](https://github.com/AbHiSHekAB01)
84+
85+
> <img src="https://avatars0.githubusercontent.com/u/54671469?s=460&v=4" width="50"> [Sweta Mukherjee](https://github.com/swetamukherjee)
86+
87+
> <img src="https://avatars0.githubusercontent.com/u/51486348?s=400&u=6a4cdee26828b21c6b13dc2c1af831c1c0b6129b&v=4" width="50"> [Anshuman Mohapatra](https://github.com/amohapatra123)
88+
89+
> <img src="https://avatars1.githubusercontent.com/u/53455642?s=460&u=144afd60f6046fe4abd459432afe593317f36523&v=4" width="50"> [Shivangi Bose](https://github.com/Shivangibose)
90+
91+
> <img src="https://avatars0.githubusercontent.com/u/53292445?s=400&u=d281c4eef56a9d6a151e88761ddf64df824ce416&v=4" width="50"> [Jigyasa-Samal](https://github.com/jigyasa-samal)
92+
93+
> <img src="https://avatars3.githubusercontent.com/u/53367345?s=400&u=72e97079457e79b14a43ef6c88e7eadd79e103bf&v=4" width="50"> [A S V K Vinayak](https://github.com/ASVKVINAYAK)
94+
95+
> <img src="https://avatars2.githubusercontent.com/u/42293958?s=460&u=5badb6c27808a289900552fbdd3bdb8ae8f7e1e1&v=4" width="50"> [Subham Sagar Paira](https://github.com/subhamsagar524/)
96+
97+
> <img src="https://avatars1.githubusercontent.com/u/44501265?s=460&u=735a8a890ce7a0cf5c1b700ee2b9c2cf1a26b916&v=4" width="50"> [Jyoti Jayadeep Jena](https://github.com/obli99/)
98+
99+
> <img src="https://avatars3.githubusercontent.com/u/60312522?s=460&u=5a24e94980fba2d98e4812c893372d5ab987a66c&v=4" width="50"> [Lipsa Mishra](https://github.com/lipsamishra1609/)
100+
101+
> <img src="https://avatars0.githubusercontent.com/u/53703526?s=400&v=4" width="50"> [Aditya Sharma](https://github.com/itsjohnty)
102+
103+
> <img src="https://avatars0.githubusercontent.com/u/53336453?s=400&u=dbe50a5612b23d5348cfaa567a559ce8335ef6f0&v=4" width="50"> [Ashish Senapati](https://github.com/ash0202)
104+
105+
> <img src="https://avatars3.githubusercontent.com/u/61560828?s=460&u=d04ff431560bf91b4c611a092dda04d8f34b887c&v=4" width="50"> [Siddhant Jaiswal](https://github.com/SiddhantJaiswal-0125)
106+
107+
> <img src="https://avatars2.githubusercontent.com/u/48730894?s=400&u=9300f22370740e1438430c32488948a20ddbcf87&v=4" width="50"> [Subhransu Dash](https://github.com/Ashis-007)
108+
109+
> <img src="https://avatars1.githubusercontent.com/u/53336715?s=460&u=f7716ac9e0b6bbf56e97f9622ae005bd0fa8dc8e&v=4" width="50"> [Bravish Ghosh](https://github.com/LoopGlitch26/)
110+
111+
> <img src="https://avatars2.githubusercontent.com/u/53439283?s=400&u=52f3ed030e21e74d387f5a1fdca9035413bd0828&v=4" width="50"> [Sourav Kumar Prusty](https://github.com/SouravReal)
112+
113+
> <img src="https://avatars0.githubusercontent.com/u/50355217?s=460&u=550177157f4e556fe1a1ed458d0b50fdcc4a5a54&v=4" width="50"> [Bikash Kumar Dash](https://github.com/bikash1317)
114+
115+
> <img src="https://avatars3.githubusercontent.com/u/53293250?s=400&u=83a124da28741dcbb4b9463bc55fb1da7e9b9a3c&v=4" width="50"> [Palak Srivastava](https://github.com/Palak-Srivastava)
116+
117+
> <img src="https://avatars0.githubusercontent.com/u/53379005?s=400&u=a852e463c8cbae7653bf7651c0844b384ab7a7d8&v=4" width="50"> [Utkarsh Shankar](https://github.com/UtkarshShankar)
118+
119+
> <img src="https://avatars0.githubusercontent.com/u/52209941?s=460&u=10cdd32a6dffc5d10e4dfd6d46821e59fbff5ca6&v=4" width="50"> [Saurabh Nikam](https://github.com/saurabh-nikam/)
120+
121+
> <img src="https://avatars1.githubusercontent.com/u/53162729?s=400&u=16783675e602b7de353919c32357c7e12bc69ee3&v=4" width="50"> [Sahil Agarwal](https://github.com/agarwalsahil0210)
122+
123+
> <img src="https://avatars1.githubusercontent.com/u/53288567?s=400&u=affbca75ed842d8471ee39b7ff0e80987607f359&v=4" width="50"> [Sonu Kumar Sharma](https://github.com/Sharma-chanism)

README.md

Lines changed: 8 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,17 @@
22

33
Here we will have collection of solution of cses.fi
44

5-
### Instrutions to Contribute:
5+
## Info:
66

7-
- First,go to [cses](https://cses.fi)
7+
- It will help you in Hacktoberfest 2020
88

9-
- Create a new account first & log in
9+
- Learning about Open source contributions
1010

11-
- Then, go to [CSES Problem Set](https://cses.fi/problemset/)
11+
```You can star and fork this repository on GitHub by navigating at the top of this repository.```
1212

13-
- Choose any 5 questions of your choice and solve them
13+
### CONTRIBUTE
14+
- Head over to [CONTRIBUTING.md](https://github.com/Hackodex-ITER/CSES-Problems/blob/master/CONTRIBUTING.md) to make Contributions
1415

15-
(Unique questions/language would be appreciated)
16+
## Official Banner
1617

17-
- To solve any particular question, click on it and then solve it first on your local IDE.
18-
19-
- Then upload that file (like missing_number.c or missing_number.java,etc.) from your local system in the submit section of that particular question.
20-
21-
- Once it successfully passes all the test cases
22-
23-
- fork [this] repo
24-
- Add question as comments at top & its link
25-
- Now add "author: cses id" as comment at the end of your program (e.g. - author: pritam047)
26-
- Example: Python Code
27-
```python
28-
# Print your Name
29-
# cses.fi/printName
30-
print('Ayush> Kejariwal')
31-
# author: KejariwalAyush
32-
# solution: https://cses.fi/problemset/result/1065540/
33-
# profile: https://cses.fi/user/32415
34-
```
35-
- Rename that particular file here in the following format:
36-
- githubusername_problemname.fileformat (e.g. - pritam047_missing_number.c)
37-
- Make a folder of your Github Username & put above file in it (if already exists then add in it)
38-
- Add that folder into your stack(language e.g. java, python, etc) folder
39-
> example: master/java/KejariwalAyush/KejariwalAyush_missing_number.java
40-
- Now commit and push to your repo
41-
- And make a pull request to original repo
42-
43-
- Once we validate it, we shall accept your pull request.
44-
45-
**Note : Don't simply copy paste from others. Try to solve the problems on your own.**
46-
47-
### Example of passing test in cses
48-
49-
When you submit the answer to the question in [cses](https://cses.fi)
50-
51-
You should pass all tests, then only submit it here.
52-
53-
![Example](https://github.com/Hackodex-ITER/Hackodex-ITER/blob/master/example.jpg?raw=true)
18+
![Banner](https://github.com/Hackodex-ITER/Hackodex-ITER/blob/master/Hacktober.png?raw=true)

c/c.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

c_plus_plus/.DS_Store

6 KB
Binary file not shown.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
Weird algorithm
3+
Consider an algorithm that takes as input a positive integer n. If n is even, the algorithm divides it by two, and if n is odd, the algorithm multiplies it by three and adds one. The algorithm repeats this, until n is one. For example, the sequence for n=3 is as follows:
4+
3?10?5?16?8?4?2?1
5+
6+
Your task is to simulate the execution of the algorithm for a given value of n.
7+
8+
Question link : https://cses.fi/problemset/task/1068
9+
Profile Link :https://cses.fi/user/32376
10+
Author: ASVKVINAYAK
11+
*/
12+
13+
#include<iostream>
14+
using namespace std;
15+
16+
void disp(long long int n)
17+
{
18+
if(n==1)
19+
{
20+
exit(0);
21+
}
22+
if(n%2==0)
23+
{
24+
n=n/2;
25+
}
26+
else
27+
n=n*3 +1;
28+
cout<<n<<" ";
29+
disp(n);
30+
}
31+
int main()
32+
{
33+
long long int n;
34+
cin>>n;
35+
cout<<n<<" ";
36+
if(n==1)
37+
{
38+
exit(0);
39+
}
40+
else
41+
{
42+
disp(n);
43+
}
44+
return 0;
45+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
Bit Strings
3+
4+
Your task is to calculate the number of bit strings of length n.
5+
6+
For example, if n=3, the correct answer is 8, because the possible bit strings are 000, 001, 010, 011, 100, 101, 110, and 111.
7+
8+
Question link : https://cses.fi/problemset/task/1617
9+
Profile Link :https://cses.fi/user/32376
10+
Author: ASVKVINAYAK
11+
12+
*/
13+
14+
15+
#include<iostream>
16+
#include <bits/stdc++.h>
17+
using namespace std;
18+
int main()
19+
{
20+
long long int n,s=1,i;
21+
cin>>n;
22+
for(i=1;i<=n;++i)
23+
{
24+
s= (s*2)%1000000007;
25+
}
26+
cout<<s<<endl;
27+
return 0;
28+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
Missing Number
3+
You are given all numbers between 1,2,…,n except one. Your task is to find the missing number.
4+
Question link : https://cses.fi/problemset/task/1083/
5+
Profile Link :https://cses.fi/user/32376
6+
Author: ASVKVINAYAK
7+
*/
8+
9+
#include<iostream>
10+
using namespace std;
11+
int main()
12+
{
13+
long long int s=0,n,a;
14+
cin>>n;
15+
s=(n*(n+1))/2;
16+
int i;
17+
for(i=1;i<=n-1;++i)
18+
{
19+
cin>>a;
20+
s=s-a;
21+
}
22+
cout<<s<<endl;
23+
return 0;
24+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
Repetitions
3+
4+
You are given a DNA sequence: a string consisting of characters A, C, G, and T. Your task is to find the longest repetition in the sequence. This is a maximum-length substring containing only one type of character.
5+
6+
Question link : https://cses.fi/problemset/task/1069
7+
Profile Link :https://cses.fi/user/32376
8+
Author: ASVKVINAYAK
9+
10+
*/
11+
12+
#include <bits/stdc++.h>
13+
using namespace std;
14+
int main()
15+
{
16+
string ss;
17+
cin >> ss;
18+
long long int c=1,i,s=0;
19+
for ( i=0;i<ss.length()-1;++i)
20+
{
21+
s=1;
22+
while (ss[i]==ss[i+1])
23+
{
24+
25+
s++;
26+
i++;
27+
}
28+
if (s>c)
29+
{
30+
c=s;
31+
}
32+
}
33+
cout <<c<<endl;
34+
return 0;
35+
}
36+

0 commit comments

Comments
 (0)