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 <bits/stdc++.h> | |
| using namespace std; | |
| using ll = long long; | |
| using vi = vector<int>; | |
| using vll = vector<ll>; | |
| #define __lcm(a, b) (1LL * ((a) / __gcd((a), (b))) * (b)) | |
| #define all(x) (x).begin(),(x).end() | |
| #define pb push_back | |
| #define mp make_pair |
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> | |
| #include <string.h> | |
| char a[100]; | |
| char b[100]; | |
| void trace(int n, char t[][n + 1], int i, int j) { | |
| if (t[i][j] == 'u') { | |
| trace(n, t, i - 1, j); | |
| } else if (t[i][j] == 'l') { |
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 <bits/stdc++.h> | |
| using namespace std; | |
| int main() { | |
| string a, b; cin >> a >> b; | |
| int m = a.size(), n = b.size(); | |
| vector<int> prev(n + 1, 0); | |
| vector<int> curr(n + 1, 0); | |
| for (int i = 1; i <= m; 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 <bits/stdc++.h> | |
| using namespace std; | |
| using ll = long long; | |
| ll change(int t, vector<int> &v, vector<int> &dp) { | |
| if (t == 0) return 0; | |
| ll m = INT_MAX; | |
| if (dp[t] != -1) return dp[t]; |
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 <bits/stdc++.h> | |
| using namespace std; | |
| int main() { | |
| int n; double c; cin >> n >> c; | |
| // weight, value | |
| vector<pair<int, int>> v; | |
| double ans = 0; | |
| while (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> | |
| #define QUEUE_SIZE 100 | |
| #define STACK_SIZE 100 | |
| #define MAX_CONN 8 | |
| int queue[QUEUE_SIZE]; | |
| int front = -1, rear = -1; | |
| int stack[STACK_SIZE]; |
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> | |
| #include <stdlib.h> | |
| #define MAX 10 | |
| typedef struct Node { | |
| int data; | |
| struct Node *next; | |
| } Node; |
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> | |
| #include <stdlib.h> | |
| typedef struct Node { | |
| int data; | |
| struct Node *left, *right; | |
| } Node; | |
| Node* createNode(int data) { | |
| Node* n = (Node*)calloc(1, sizeof(Node)); |
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> | |
| #include <stdlib.h> | |
| #include <ctype.h> | |
| #include <math.h> | |
| #define MAX_SIZE 100 | |
| typedef struct Stack { | |
| int arr[MAX_SIZE]; | |
| int top; |
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> | |
| #include <stdlib.h> | |
| #define MAX_SIZE 100 | |
| typedef struct Stack { | |
| int arr[MAX_SIZE]; | |
| int top; | |
| } Stack; |
NewerOlder