49312023-04-07 13:47:06zolmikiVilágnaptár (45 pont)javaWrong answer 4/4590ms51764 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;
        

        for(int i = 0; i < 12; i++){
            if(passedDays - worldMonthLenghts[i] <= 0){
                month = i + 1;
                break;
            } else {
                passedDays -= worldMonthLenghts[i];
            }
        }

        System.out.println(year + " " + month + " " + passedDays);
    }
}
SubtaskSumTestVerdictTimeMemory
base4/45
1Wrong answer0/083ms46112 KiB
2Accepted0/090ms47656 KiB
3Accepted0/086ms48052 KiB
4Wrong answer0/290ms48224 KiB
5Accepted2/282ms48644 KiB
6Wrong answer0/382ms48932 KiB
7Wrong answer0/389ms50136 KiB
8Wrong answer0/382ms49888 KiB
9Wrong answer0/389ms50340 KiB
10Wrong answer0/383ms51196 KiB
11Wrong answer0/389ms50964 KiB
12Wrong answer0/390ms51060 KiB
13Wrong answer0/390ms51016 KiB
14Wrong answer0/390ms50520 KiB
15Wrong answer0/383ms51376 KiB
16Wrong answer0/389ms50940 KiB
17Wrong answer0/389ms51648 KiB
18Accepted2/285ms51640 KiB
19Wrong answer0/389ms51764 KiB