본문 바로가기

카테고리 없음

2021-01-15 08시 개발자 글 모음 | "새벽 길" 외 8개 이야기

예외 처리 by 박용훈

  • public Integer test(int num) { try { return 0/num; } catch (Exception e) { throw new RuntimeException(); } }
  • public class PositiveArraySizeException extends NegativeArraySizeException{ private static final String MESSAGE = "배열의 크기가 양수입니다
  • println("action"); throw new ARuntimeException(); } @Override public void close() { System


열혈 자료구조 - 11.1 탐색의 이해와 보간 탐색 by 박세용

  • - 위치를 예측하면 정확하지는 않을 수 있지만 많은 수의 데이터를 배제시킬 수 있음
  • -> 위 계산에 x에 실제 찾고자하는 값을 넣으면 탐색 위치의 인덱스 s를 구할 수 있음
  • int target) { int mid; if(ar[first]>target || ar[last]


스프링 핵심 원리 - 기본편 #4 좋은 객체지향 프로그래밍이란? by 서진규 about Spring


    power shell by 허정진

    • toString() + ' GB'; } elseif ($size -gt 1048576) { $ConvertSize = [math]::Round($size/1MB
    • Sum); } #Get-ChildItem $strPath -Directory | % {' ' + $_
    • \" $seperate = " | " $a=@{} Get-ChildItem $searchPath -Recurse -Directory -ErrorAction Ignore | Foreach { $a[$_


    USACO 2020 December Silver Contest by 나정휘

    • sizeof dst ); for ( int i = 1 ; i <= n ; i ++ ){ cin >> d [ i ] >> a [ i ]; x_comp
    • y ); } compress ( x_comp ); compress ( y_comp ); for ( int i = 1 ; i < n ; i ++ ){ xw [ i * 2 ] = x_comp [ i ] - x_comp [ i - 1 ] - 1 ; yw [ i * 2 ] = y_comp [ i ] - y_comp [ i - 1 ] - 1 ; } for ( int i = 1 ; i <= n ; i ++ ) xw [ i * 2 - 1 ] = yw [ i * 2 - 1 ] = 1 ; for ( int i = 1 ; i <= n ; i ++ ){ a [ i ]
    • push_back ( idx ); // make tree par [ idx ] = id [ i ][ j ]; // make tree continue ; } id [ i ][ j ] = idx ; dst [ i ][ j ] = cst ; int ii = i + dx [ k ]


    스프링 핵심 원리 - 기본편 #5 좋은 객체지향 설계의 5가지 원칙(SOLID) by 서진규 about Spring


      스프링 핵심 원리 - 기본편 #6 객체지향 설계와 스프링 by 서진규 about Spring


        백준20188 등산 마니아 by 나정휘 about 백준,Algorithm

        • P [ 303030 ]; vector < int > G [ 303030 ]; ll R ; ll C2 ( int x ){ return 1LL * x * ( x - 1 ) / 2 ; } int DFS ( int v
        • int b = - 1 ){ S [ v ] = 1 ; P [ v ] = b ; for ( const auto i : G [ v ]) if ( i != b ) D [ i ] = D [ v ] + 1
        • push_back ( s ); } DFS ( 1 ); for ( int i = 1 ; i <= N ; i ++ ) R += 1LL * S [ i ] * ( N - S [ i ]); for ( int i = 1 ; i <= N ; i ++ ){ ll now = C2 ( S [ i ]); for ( const auto j : G [ i ]) if ( j != P [ i ]) now -= C2 ( S [ j ]); R += now * D [ i ]; } cout << R ; }


        새벽 길 by 박정규