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
class Solution { | |
public: | |
int max(int a, int b) { | |
return a > b ? a : b; | |
} | |
int min(int a, int b) { | |
return a < b ? a : b; | |
} | |
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 <cstdio> | |
long int s1[1000010]; | |
long int s2[1000010]; | |
int main() | |
{ | |
int M,N; | |
scanf("%d", &M); | |
for (int i = 0; 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 <stdio.h> | |
int node[100010]; | |
char hash[100010]; | |
int main() | |
{ | |
int start_a, start_b; | |
int i, n; | |
int a, b; |
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 <cstdio> | |
#include <algorithm> | |
using namespace std; | |
void quicksort( int *num, int start, int end){ | |
if( start >= end ){ | |
return; | |
} | |
int temp = num[start]; |
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 <stdlib.h> | |
#include <stdio.h> | |
#define MAX_TIME 9*60 | |
int main(){ | |
int N, M, K, Q; | |
scanf( "%d %d %d %d", &N, &M, &K, &Q ); | |
int **win = (int **)malloc(sizeof(int *)*N); | |
int 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 <stdlib.h> | |
#include <stdio.h> | |
typedef struct node { | |
int data; | |
struct node *left; | |
struct node *right; | |
} node_t; | |
typedef struct queue { |
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 <cstdio> | |
#include <queue> | |
using namespace std; | |
struct node_t { | |
node_t *left; | |
node_t *right; | |
int data; | |
}; |
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 { | |
struct node *child; | |
struct node *brother; | |
} node_t; | |
void count_leaf(node_t *node, int *counts, int height, int *depth) | |
{ |
NewerOlder