Skip to content

Instantly share code, notes, and snippets.

View ankisile's full-sized avatar
🙂

Minyoung Song ankisile

🙂
View GitHub Profile
@ankisile
ankisile / [Baekjoon]1157.c
Created August 31, 2020 15:04
[Baekjoon]1157
#include <stdio.h>
#include <string.h>
int main(){
int s[91]={0}, max=0, chr=0;
char str[1000001];
scanf("%s", str);
int len = strlen(str);
for(int i=0;i<len;i++){
#include <stdio.h>
#include <string.h>
int main(){
char s[1000001];int num=0;
gets(s);
for(int i=0;i<strlen(s);i++){
if(s[i]==' '){
num++;
#include <stdio.h>
#include <math.h>
void hanoi(int n, int a, int b);
int main(){
int n;
scanf("%d", &n);
int count = pow(2,n)-1;
printf("%d\n", count);
#include <stdio.h>
void hanoi(int n, int a, int b);
void h_count(int n, int a, int b);
int count;
int main(){
int n;
scanf("%d", &n);
h_count(n,1,3);
#include <stdio.h>
int arr[1000001];
void merge(int left, int mid, int right){
int left_end, pos, num_items;
int num[1000001];
pos=left;
left_end=mid-1;
num_items=right-left+1;
int getHeight(struct node* root) {
int left_h, right_h;
if(root){
left_h = getHeight(root->left);
right_h = getHeight(root->right);
return 1+((left_h>right_h)?left_h:right_h);
}
else {
return -1;
}
int getHeight(struct node* root) {
int left_h, right_h;
if(root){
left_h = getHeight(root->left);
right_h = getHeight(root->right);
return 1+((left_h>right_h)?left_h:right_h);
}
else {
return -1;
}
int getHeight(struct node* root) {
int left_h, right_h;
if(root){
left_h = getHeight(root->left);
right_h = getHeight(root->right);
return 1+((left_h>right_h)?left_h:right_h);
}
else {
return -1;
}
struct node* insert( struct node* root, int data ) {
struct node *node = (struct node *)malloc(sizeof(struct node));
struct node *temp, *prev;
node->data = data;
node->left=node->right=NULL;
if(root==NULL){//root is empty
root=node;
return root;
#include <stdio.h>
int main(){
int n, arr[1000], i, j, temp;
scanf("%d", &n);
for(i=0;i<n;i++){
scanf("%d", &arr[i]);
}
for(i=1;i<n;i++){