49302023-04-07 13:43:00zolmikiVilágnaptár (45 pont)javaWrong answer 18/4592ms51960 KiB
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class main {


    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String [] readed  = br.readLine().split(" ");
        int year = Integer.parseInt(readed[0]);
        int month = Integer.parseInt(readed[1]);
        int day = Integer.parseInt(readed[2]);
        boolean isLeapYear = year % 4 == 0;
        int [] normalMonthLengths = new int[]{31, isLeapYear ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
        int [] worldMonthLenghts = new int[]{31, 30, 30, 31, 30, isLeapYear ? 31 : 30, 31, 30, 30, 31, 30, 30};

        if(month == 12 && day == 31){
            System.out.println(year + " 12 VN");
            return;
        } else if(isLeapYear && month == 7 && day == 1) {
            System.out.println(year + " 6 SZN");
            return;
        }

        int passedDays = 0;
        for(int i = month - 1; i >= 0; i--){
            passedDays += normalMonthLengths[i];
        }
        passedDays += day;

        int worldMonth = 0;

        for(int i = 0; i < 12; i++){
            if(passedDays - worldMonthLenghts[i] > 0){
                passedDays -= worldMonthLenghts[i];
                worldMonth++;
            }
        }

        System.out.println(year + " " + worldMonth + " " + passedDays);
    }
}
SubtaskSumTestVerdictTimeMemory
base18/45
1Accepted0/086ms46144 KiB
2Accepted0/083ms46780 KiB
3Accepted0/083ms47408 KiB
4Accepted2/289ms47484 KiB
5Accepted2/289ms48304 KiB
6Wrong answer0/390ms49172 KiB
7Wrong answer0/390ms49824 KiB
8Accepted3/389ms50008 KiB
9Wrong answer0/389ms50448 KiB
10Wrong answer0/389ms50276 KiB
11Wrong answer0/385ms50496 KiB
12Wrong answer0/382ms50796 KiB
13Wrong answer0/392ms50728 KiB
14Wrong answer0/390ms51308 KiB
15Wrong answer0/390ms51504 KiB
16Accepted3/386ms51804 KiB
17Accepted3/390ms51672 KiB
18Accepted2/285ms51784 KiB
19Accepted3/390ms51960 KiB