Notice
Recent Posts
Recent Comments
Link
목록수학 (27)
Dev.baelanche
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/zoEup/btqt9BRD111/tu301yYllDAypL5x18AP31/img.png)
1929번 문제를 풀때와 마찬가지로 소수를 제거하고 n
Data Structure & Algorithm/PS - JAVA
2019. 4. 4. 22:50
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/I2kcO/btqt8mt9egO/qYx55qUDeAAtLekW8uLXw0/img.png)
1부터 1000000의 수 중에 2가 아닌 2의 배수, 3이 아닌 3의 배수, 5가 아닌 5의 배수를 제외한 나머지를 출력한다. public static void main(String[] args) { Scanner sc = new Scanner(System.in); int m = sc.nextInt(); int n = sc.nextInt(); int prime[] = new int[n+1]; prime[1] = 0; for(int i=2; i
Data Structure & Algorithm/PS - JAVA
2019. 4. 4. 22:47
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/RpQVE/btqt0t74mD9/puVpry81KaIWdfyYlZc6Dk/img.png)
등차수열 공식을 이용했다. 따라서 x는 이다. N, t, l 모두 주어지므로 수열의 처음시작인 X 를 구하여 x, x+1, x+2, ..., x+l-1 를 출력하면 된다. public static int sequenceSum(int n) { n = n*(n+1)/2; return n; } public static int compareSum(int x, int l) { int sum = 0; for(int i=0; i
Data Structure & Algorithm/PS - JAVA
2019. 4. 1. 21:09