회원가입
로그인
Toggle navigation
문제
문제
전체 문제
문제 출처
단계별로 풀어보기
알고리즘 분류
추가된 문제
문제 순위
문제
푼 사람이 한 명인 문제
아무도 못 푼 문제
최근 제출된 문제
최근 풀린 문제
랜덤
출처
ICPC
Olympiad
한국정보올림피아드
한국정보올림피아드시․도지역본선
전국 대학생 프로그래밍 대회 동아리 연합
대학교 대회
카카오 코드 페스티벌
Coder's High
ICPC
Regionals
World Finals
Korea Regional
Africa and the Middle East Regionals
Europe Regionals
Latin America Regionals
North America Regionals
South Pacific Regionals
문제집
대회
4
채점 현황
랭킹
게시판
그룹
더 보기
재채점 기록
블로그
강의
실험실
도움말
BOJ Stack
BOJ Book
전체
공지
자유
질문
오타/오역/요청
게시판 공지
홍보
업데이트
solved.ac
글쓰기
질문 도움말
자주묻는 질문
자바 재귀 질문입니다~~ 테스트케이스부탁드려요 ㅜ
1173번 - 운동
na1st
6년 전
0
뭐가틀린걸까요 ㅜㅜㅜㅜㅜㅜ
import java.util.Scanner; public class Main { static int N, m, M, T, R; static int present_pulse; static int count; public static void main(String[] args) { Scanner sc = new Scanner(System.in); N = sc.nextInt(); m = sc.nextInt(); M = sc.nextInt(); T = sc.nextInt(); R = sc.nextInt(); count = 0; practise(m); } public static int practise(int pulse) { present_pulse = pulse; if (N>0) { if (present_pulse + 25 <= M) { present_pulse += 25; N--; count++; //System.out.println("현재 운동" + present_pulse); return practise(present_pulse); } else { return rest(present_pulse); } }else{ System.out.println(count); return 1; } } public static int rest(int pulse) { present_pulse = pulse; if (present_pulse - 15 < m) { present_pulse = m; if (present_pulse + 25 <= M) { return practise(present_pulse); } else { return rest(present_pulse); } } else { present_pulse -= 15; count++; //System.out.println("현재 휴식중" + present_pulse); if (present_pulse + 25 <= M) { return practise(present_pulse); } else { return rest(present_pulse); } } } }
minjun623
5년 전
0
24번, 25번, 44번, 47번, 55번, 59번 라인 우선 수정 해주세여
댓글을 작성하려면
로그인
해야 합니다.
na1st 6년 전
뭐가틀린걸까요 ㅜㅜㅜㅜㅜㅜ