This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"editor.tabSize": 3, | |
"editor.insertSpaces": false, | |
"editor.renderWhitespace": "boundary", | |
"editor.detectIndentation": false, | |
"editor.wrappingColumn": 1000, | |
"workbench.welcome.enabled": true, | |
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe", | |
"explorer.openEditors.visible": 0 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Samples | |
{ | |
/// <summary> | |
/// 동기적으로 재시도를 해야하는 경우 사용되는 retry 함수입니다. | |
/// </summary> | |
public class Retry | |
{ | |
/// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LogUtil { | |
static int log2 (int number) { | |
int logCount = 0; | |
while(number>>=1 > 0) logCount++; | |
return logCount; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void move(int from, int to){ | |
printf("\nMove from %d to %d", from, to); | |
} | |
// n개의 원반을 from 에서 by를 거쳐 to로 옮긴다. | |
void hanoi(int n, int from, int by, int to){ | |
if (n == 1) | |
move(from, to); | |
else{ | |
hanoi(n - 1, from, to, by); // 1번 N-1개의 원반을 기둥3을 거쳐 2로 옮긴다. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestTimeout | |
{ | |
static void Main(string[] args) | |
{ | |
new Timeout( | |
start: () => | |
{ | |
Thread.Sleep(10000); | |
Console.WriteLine("it's working!"); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LogUtil { | |
static int log2 (int number) { | |
int logCount = 0; | |
if(65536 <= number) { logCount += 16; number >>= 16; } | |
if(256 <= number) { logCount += 8; number >>= 8; } | |
if(16 <= number) { logCount += 4; number >>= 4; } | |
if(4 <= number) { logCount += 2; number >>= 2; } | |
return logCount + (2 <= number ? 1 : 0); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package problem.boj; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.Scanner; | |
/** | |
* Created by Jinseoung on 2017-01-01. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package problem.boj; | |
import java.util.Scanner; | |
/** | |
* Created by Jinseoung on 2017-01-01. | |
*/ | |
public class ValueToAnagram { | |
static Scanner sc = new Scanner(ClassLoader.getSystemResourceAsStream("problem/boj/ValueToAnagram.testcase")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package problem.boj; | |
import java.util.Scanner; | |
/** | |
* Created by Jinseoung on 2017-01-01. | |
*/ | |
public class AnagramDistance { | |
static Scanner sc = new Scanner(ClassLoader.getSystemResourceAsStream("problem/boj/AnagramDistance.testcase")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package problem.boj; | |
import java.util.Scanner; | |
/** | |
* Created by Jinseoung on 2017-01-01. | |
*/ | |
public class Anagram { | |
static boolean isAnagram (String s1, String s2) { |