알고리즘73 [Java] 자바 컬렉션들의 시간 복잡도 https://gyuwon95.tistory.com/m/99 2022. 1. 11. 자바 소수 판별 알고리즘 boolean isPrime(int number) { if(number < 2) return false; if(number == 2) return true; for(int i = 2; i < number; i++) { if(number % i == 0) return false; } return true; } 2021. 12. 24. 자바 10진수를 N진수로 바꿔주는 함수 단, N는 16이하이고, 10~15는 'A'~'F'로 표현 String convertToN(int from, int n){ String to = ""; while(true){ int rem = from % n; int div = from / n; if(rem>=10){ to = (char)('A' + rem - 10) + to; } else { to = rem + to; } if(div==0) break; from = div; } return to; } 2021. 12. 22. 자바 알고리즘에서 자주 쓰이는 코드 https://redbinalgorithm.tistory.com/579 https://real-012.tistory.com/152 import java.io.*; import java.util.StringTokenizer; public class Main { static FastIO io = new FastIO(); public static void main(String[] args) throws IOException { try { // 문제 풀이 코드 } catch(Exception e) { e.printStackTrace(); } finally { io.flush(); io.close(); } } } class FastIO { static BufferedReader br; static Buffered.. 2021. 7. 26. 이전 1 2 3 4 ··· 19 다음