This file contains hidden or 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
| #include <iostream> | |
| #include <vector> | |
| using namespace std; | |
| //programare dinamica | |
| class Solution { | |
| public: | |
| vector<vector<int>> generate(int numRows) { |
This file contains hidden or 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
| #include <iostream> | |
| #include <vector>//template | |
| //bubblesort, selection by minimum, insertion sort | |
| //2 3 9 4 -1 23 4 54 | |
| // | |
| using namespace std; |
This file contains hidden or 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
| #include <iostream> | |
| using namespace std; | |
| class Solution { | |
| //n = 18 | |
| public: |
This file contains hidden or 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
| #include <iostream> | |
| using namespace std; | |
| int main(int argc, char const *argv[]) | |
| { | |
| unsigned n;//input n natural | |
| cin>>n; |
This file contains hidden or 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
| #include <stdio.h> | |
| void fb() { | |
| int n; | |
| scanf("%d", &n); | |
| int arr[ n ]; | |
| for(int i = 0; i < n; ++i) scanf("%d", &arr[i]); |
This file contains hidden or 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
| #include <iostream> | |
| using namespace std; | |
| /* | |
| Sirul lui Fibonacci: | |
| 0,1,1,2,3,5,8,13,21,34,....+infinit | |
| */ |
This file contains hidden or 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
| /* | |
| 1 2 3 4 | |
| 5 6 7 8 | |
| 8 9 1 2 | |
| 3 4 5 6 | |
| int numere[4] = {1,2,3,4}; | |
| 0 1 2 3 | |
| int matrix[4][4]; |
This file contains hidden or 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
| //n! = 1 * 2 * 3 * ..*n | |
| //5! = 1 * 2 * 3 * 4 * 5 = 120 | |
| #include <iostream> | |
| using namespace std; | |
| int main() | |
| { | |
| long long int nr, s = 1, i; |
This file contains hidden or 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
| /* | |
| n = 5 | |
| V = 24 12 15 15 19 | |
| Longest Increasing Subsequence (LIS) | |
| */ | |
| #include <bits/stdc++.h> |
This file contains hidden or 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
| #include <iostream> | |
| #include <fstream> | |
| #define FIN "triangle.in" | |
| #define FOUT "triangle.out" | |
| #define SIZE 101 | |
| using namespace std; | |
| int i, n, Tri[SIZE][SIZE], |