목록분류 전체보기 (211)
Hansel
#define _CRT_SECURE_NO_WARNINGS #include #include typedef struct treenode { int data; struct treenode *left, *right; }treenode; treenode t8 = { 8,NULL,NULL }; treenode t9 = { 9,NULL,NULL }; treenode t4 = { 4,&t8,&t9 }; treenode t5 = { 5,NULL,NULL }; treenode t2 = { 2,&t4,&t5 }; treenode t6 = { 6,NULL,NULL }; treenode t7 = { 7,NULL,NULL }; treenode t3 = { 3,&t6,&t7 }; treenode t1 = { 1,&t2,&t3 };..
#include #include typedef int element; typedef struct DListNode {// 이중연결 노드 타입 element data; struct DListNode* llink; struct DListNode* rlink; } DListNode; // 이중 연결 리스트를 초기화 void init(DListNode* phead) { phead->llink = phead; phead->rlink = phead; } // 이중 연결 리스트의 노드를 출력 void print_dlist(DListNode* phead) { DListNode* p; for (p = phead->rlink; p != phead; p = p->rlink) { printf(" ", p->data); } p..
#include #include typedef int element; typedef struct ListNode { // 노드 타입 element data; struct ListNode *link; } ListNode; // 리스트의 항목 출력 void print_list(ListNode* head) { ListNode* p; if (head == NULL) return; p = head; do { printf("%d->", p->data); p = p->link; } while (p -> link != head); printf("%d \n", p->data); // 마지막 노드 출력 } ListNode* insert_first(ListNode* head, element data) { ListNode *..
#include #include typedef struct node { int data; struct node* link; }LinkedList; LinkedList* insert_f(LinkedList* head, int value) { LinkedList* node = (LinkedList*)malloc(sizeof(LinkedList)); node->data = value; node->link = head; head = node; return head; } LinkedList* del_f(LinkedList* head) { LinkedList* temp = head; head = temp->link; free(temp); return head; } void get_entry(LinkedList* h..

import java.util.Scanner; public class Main { static int n; static int[] board; static int result=0; public static boolean promising(int level){ boolean flag = true; int prior = 1; while(prior
import java.util.Scanner; public class Main2 { public static void main(String[] args) { Scanner kb = new Scanner(System.in); int n = kb.nextInt(); int[] dp = new int[n+1]; dp[1] = 0; for(int i=2;i
import java.util.Scanner; public class Main2 { public static void main(String[] args) { Scanner kb = new Scanner(System.in); int n = kb.nextInt(); int[] arr = new int[n]; int[] dp = new int[n]; int max = 0; dp[0]=1; for(int i=0;imax) max = dp[i]; } } System.out.print(max); } }

import java.util.Scanner; public class Main2 { public static void main(String[] args) { Scanner kb = new Scanner(System.in); int n = kb.nextInt(); int[] arr = new int[n]; int[] dp = new int[n]; for(int i=0;i