49292023-04-07 13:37:12zolmikiVilágnaptár (45 pont)javaWrong answer 9/4590ms51464 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 = day;
        for(int i = month - 1; i >= 0; i--){
            passedDays += normalMonthLengths[i];
        }

        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
base9/45
1Accepted0/090ms45868 KiB
2Accepted0/086ms47216 KiB
3Accepted0/089ms48036 KiB
4Accepted2/289ms48036 KiB
5Accepted2/286ms48736 KiB
6Wrong answer0/390ms48696 KiB
7Wrong answer0/389ms49292 KiB
8Accepted3/385ms49820 KiB
9Wrong answer0/382ms50028 KiB
10Wrong answer0/383ms50456 KiB
11Wrong answer0/382ms50060 KiB
12Wrong answer0/383ms50320 KiB
13Wrong answer0/389ms50608 KiB
14Wrong answer0/385ms50468 KiB
15Wrong answer0/382ms50392 KiB
16Wrong answer0/389ms51344 KiB
17Wrong answer0/389ms50884 KiB
18Accepted2/285ms51136 KiB
19Wrong answer0/382ms51464 KiB