기본 콘텐츠로 건너뛰기

Setting Visual Studio Code For Competitive Programming

[LINK] General Setup Debug Setup  - one tip for getting std input from VSCode is setting externalConsole property to true.
최근 글

Codeforces Div2 #198 C.Tourist Problem - Dealing with division between large numbers

When dealing with division between large numbers, We need to remember the quotient is turned into 'float' but float does not support such large numbers. Therefore, you need to convert 'float' to 'int' first and then do division. One of the trick is using '//' operator. For example, 10//3 output 3, 10//4 outputs 2. Source :  Hadling very large numbers in Python

Tree traversal의 3가지

1. 전위 순회 (Preorder Traversal) Root -> Left Tree -> Right Tree   ( 루트를 제일 처음에 방문 ) 2. 중위 순회 (Inorder Traversal) Left Tree -> Root -> Right Tree   ( 루트를 중간에 방문 ) 3. 후위 순회 (Postorder Traversal) Left Tree -> Right Tree -> Root   ( 루트를 제일 마지막에 방문 ) <소스코드> 출처 : http://www.geeksforgeeks.org/tree-traversals-inorder-preorder-and-postorder /// C program for different tree traversals #include <stdio.h> #include <stdlib.h> /* A binary tree node has data, pointer to left child    and a pointer to right child */ struct node {      int data;      struct node* left;      struct node* right; }; /* Helper function that allocates a new node with the    given data and NULL left and right pointers. */ struct node* newNode(int data) {      struct node* node = (struct node*)                                   malloc(sizeof(struct node));      node->data = data;      node->left = NULL;      node->right = NULL;      return(node);

Spanning Tree, AOE Network

Spanning Tree Graph에 있는 모든 vertex들을 포함하면서, 최소한의 edge를 가지는 tree AOE Network 프로젝트 해결을 위해 수행되는 작업 순서를 나타내는 그래프이다. 간선은 작업과 작업시간을 나타내고, 정점이 공정(작업의 완료)를 나타낸다. Critical Path : 프로젝트를 완료할 수 있는 경로중에서 가장 긴 경로