일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- react firebase
- React JS
- 프로그래머스 자바
- 장고
- 프로그래머스
- Java
- 컴퓨터 네트워크
- vanillaJS
- react hook
- codesandbox
- 프로그래머스 완전탐색
- useEffect
- 데이터모델링과마이닝
- useState
- 자바스크립트
- design pattern
- 코틀린
- JavaScript
- 프로그래밍 언어론
- NextJS
- 자바 공부
- 리액트 훅
- 백준
- websocket
- 리액트
- 디자인 패턴
- 코딩테스트 고득점 Kit
- 자바
- 코딩테스트 고득점 Kit 완전탐색
- react
Archives
- Today
- Total
목록백준 2389 자바 (1)
기록하는 개발자
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/oLsjv/btq9nCvG2RH/EbZkPXClj4ZI1zZZvbkuOk/img.png)
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int N = in.nextInt(); if (N == 4 || N == 7) System.out.println(-1); else if (N % 5 == 0) System.out.println(N / 5); else if (N % 5 == 1 || N % 5 == 3) System.out.println((N / 5) + 1); else if (N % 5 == 2 || N % 5 == 4) System.out.println((N / 5) + 2); } }
Algorithm
2021. 7. 11. 16:06