본문 바로가기
반응형

TechNical245

WinSCP 업로드 스크립트 만들기 GUI에서 한땀한땀 클릭해서 정성스럽게 올려도 되지만 반복적으로 올릴 때는 스크립트를 사용하도록 하자. 1. 업로드배치 파일 만들기 upload.bat 파일을 만든다. 내용은 아래와 같이. [설치경로]/WinSCP.com /script="c:₩upload.txt" 2. 업로드스크립트 만들기 upload.txt 파일을 만든다. 내용은 아래에. option batch abort option confirm off open sftp://[username]:[password]@[IP]:[PORT]/ -hostkey=* put [source path] [destination path] exit []안에는 실제 내용을 적으면 된다. 2021. 7. 16.
각종 알고리즘 모듬탕 Part 2 역시나 분류 따윈... package com.kei; import java.util.PriorityQueue; public class DFS_wordConvert { static PriorityQueue _pq; static String[] _words; static String _target; static boolean _first; static void dfs(String nWord, int idx, int count, boolean[] visited, String log) { // hit 로 첨에 들어 오는건 처리하지 않는다. if(_first == false) { count++; visited[idx] = true; } _first = false; if(nWord.equals(_target)){ .. 2021. 3. 1.
각종 알고리즘 모듬탕 Part 1 분류 따윈 아직 없다. package com.kei; import java.util.Arrays; import java.util.PriorityQueue; public class Kruscal { static class Node implements Comparable{ int st; int ed; int di; public Node(int s, int e, int d) { this.st = s; this.ed = e; this.di = d; } // 짧은 거리순으로 큐에 넣는다. public int compareTo(Node n) { return this.di - n.di; } } static int[] parent; // 최상위 부모를 찾아서 바꿔치기 한다. // [1] = 2 -> [2] = 3 ->.. 2021. 3. 1.
해커랭크 풀어 보았다. 그러하다... ㅇSherlock and Array int size = arr.size(); int leftSum = 0; int rightSum = 0; int leftIndex = 0; int rightIndex = size - 1; String answer = ""; for(int i = 0 ; i < size ; i++) { leftSum = leftSum + arr.get(leftIndex); rightSum = rightSum + arr.get(rightIndex); //System.out.println(leftSum + " " + rightSum); if(leftIndex == rightIndex) { if (leftSum == rightSum) { answer = "YES"; } else {.. 2021. 3. 1.
반응형