메모하며 성장하기
close
프로필 배경
프로필 로고

메모하며 성장하기

  • 분류 전체보기 (223)
    • IT (123)
      • 프로그래밍 (5)
      • 클라우드 (20)
      • 쿠버네티스 (32)
      • 운영체제 (33)
      • 네트워크 (0)
      • 데이터베이스 (11)
      • 자료구조 (1)
      • 알고리즘 (7)
      • 디자인패턴 (0)
      • 책리뷰 (8)
      • 세미나 및 밋업 (3)
      • 기타 (2)
      • 영어 (1)
    • 소소한 일상 (20)
    • 생활정보 (74)
    • 재테크 (6)
      • 애드센스 (2)
      • 블로그 (4)
  • 홈
  • IT
  • 소소한일상
  • 생활정보
  • 재테크

KMP알고리즘

import java.util.Scanner; public class _KMP알고리즘_ { static int[] preprocessing(String p) { int m = p.length(); int[] pi = new int[m]; pi[0] = 0; int j = 0; for (int i = 1; i 0 && p.charAt(i) != p.charAt(j)) { j = pi[j - 1]; } if (p.charAt(i) == p.charAt(j)) { pi[i] = j + 1; j += 1; } else { pi[i] = 0; } } return pi; } public static void main(String args[]) { Scanner sc = ne..

  • format_list_bulleted IT/알고리즘
  • · 2017. 5. 29.
  • textsms

Aho_corasick

import java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; class Node2 { int valid; int[] children; int pi; ArrayList indexes; Node2() { valid = -1; children = new int[26]; for (int i = 0; i < 26; i++) { children[i] = -1; } pi = -1; indexes = new ArrayList(); } } public class _Aho_corasick_ { static ArrayList trie = new ArrayList(); static int init() { Node2 x = new Node2()..

  • format_list_bulleted IT/알고리즘
  • · 2017. 5. 29.
  • textsms

문자열 집합 판별

import java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; class Node3 { int valid; int[] children; int pi; ArrayList indexes; Node3() { valid = -1; children = new int[26]; for (int i=0; i

  • format_list_bulleted IT/알고리즘
  • · 2017. 5. 29.
  • textsms

문자열매칭

import java.util.Scanner; public class _문자열매칭_ { static int match(String s, String p) { int n = s.length(); int m = p.length(); for (int i = 0; i

  • format_list_bulleted IT/알고리즘
  • · 2017. 5. 29.
  • textsms

9465_스티커_DP

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class _9465_스티커_DP { public static void main(String args[]) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.valueOf(br.readLine()); while (t-- > 0) { int n = Integer.valueOf(br.readLine()); long[][] a = new long[n + 1][2]; { String[] l..

  • format_list_bulleted IT/알고리즘
  • · 2017. 5. 29.
  • textsms

단지 번호붙이기

[입력]첫 번째 줄에는 지도의 크기 N(정사각형이므로 가로와 세로의 크기는 같으며 5≤N≤25)이 입력되고, 그 다음 N줄에는 각각 N개의 자료(0혹은 1)가 입력된다.70110100011010111101010000111010000001111100111000 [출력]첫 번째 줄에는 총 단지수를 출력하시오. 그리고 각 단지 내 집의 수를 오름차순으로 정렬하여 한 줄에 하나씩 출력하시오.3789 public class Main_단지번호붙이기 {static int N;static final int[] dr = new int[]{1,-1,0,0};static final int[] dc = new int[]{0,0,-1,1};public static void main(String[] args) throws Exc..

  • format_list_bulleted IT/알고리즘
  • · 2016. 10. 22.
  • textsms

[순열/조합] 기본

public class CM_순열조합 {public static void main(String[] args) {int[] a = new int[]{1,2,3,4};soon(a, 0, 3, 3);System.out.println();johab(new int[3], 0, 4, 3, 0);} public static void soon(int[] data, int index, int totalDataCnt, int choiceDataCnt){int temp;if(index == choiceDataCnt){int[] dd = new int[choiceDataCnt];for(int i=0; i< dd.length; i++){dd[i] = data[i];}System.out.println(Arrays.toString..

  • format_list_bulleted IT/알고리즘
  • · 2016. 10. 22.
  • textsms
  • navigate_before
  • 1
  • navigate_next
전체 카테고리
  • 분류 전체보기 (223)
    • IT (123)
      • 프로그래밍 (5)
      • 클라우드 (20)
      • 쿠버네티스 (32)
      • 운영체제 (33)
      • 네트워크 (0)
      • 데이터베이스 (11)
      • 자료구조 (1)
      • 알고리즘 (7)
      • 디자인패턴 (0)
      • 책리뷰 (8)
      • 세미나 및 밋업 (3)
      • 기타 (2)
      • 영어 (1)
    • 소소한 일상 (20)
    • 생활정보 (74)
    • 재테크 (6)
      • 애드센스 (2)
      • 블로그 (4)
최근 글
인기 글
최근 댓글
태그
  • #Kubernetes
  • #쿠버네티스
  • #인천어린이뮤지컬
  • #AWS
  • #솔라리스
  • #인천가볼만한곳
  • #티스토리
  • #오라클
  • #코로나19
  • #gcp
Copyright © 메모하며 성장하기 All rights reserved.
Designed by JJuum

티스토리툴바