Submission #171703


Source Code Expand

Copy
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Ryota
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String str = reader.readLine();
        int y = Integer.parseInt(str);
        str = reader.readLine();
        int m = Integer.parseInt(str);
        
        if(m == 1){
            m = 13;
            y -- ;
        }else if(m == 2){
            m = 14;
            y --;
        }
        
        str = reader.readLine();
        int d = Integer.parseInt(str);
        
        int past = day.days(y,m,d);
        
        int today = day.days(2014,5,17);
        
        System.out.println(today - past+"");
        
    }
    

    
}

class day{
        static public int days(int y, int m, int d){
        int days = days = 365*y + (int)(y/4) - (int)(y/100) + 
                (int)(y/400) + (int)((306*(m+1))/10) + d - 429;
        return days;
    }
}

Submission Info

Submission Time
Task A - 経過日数
User shobonara
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 1369 Byte
Status AC
Exec Time 445 ms
Memory 20668 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 4
AC × 24
Set Name Test Cases
Sample subtask0_sample01.txt, subtask0_sample02.txt, subtask0_sample03.txt, subtask0_sample04.txt
All subtask0_sample01.txt, subtask0_sample02.txt, subtask0_sample03.txt, subtask0_sample04.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_20.txt
Case Name Status Exec Time Memory
subtask0_sample01.txt AC 445 ms 20660 KB
subtask0_sample02.txt AC 416 ms 20648 KB
subtask0_sample03.txt AC 424 ms 20648 KB
subtask0_sample04.txt AC 420 ms 20664 KB
subtask1_01.txt AC 433 ms 20664 KB
subtask1_02.txt AC 431 ms 20524 KB
subtask1_03.txt AC 435 ms 20536 KB
subtask1_04.txt AC 430 ms 20652 KB
subtask1_05.txt AC 433 ms 20532 KB
subtask1_06.txt AC 432 ms 20532 KB
subtask1_07.txt AC 436 ms 20660 KB
subtask1_08.txt AC 434 ms 20660 KB
subtask1_09.txt AC 424 ms 20532 KB
subtask1_10.txt AC 439 ms 20652 KB
subtask1_11.txt AC 442 ms 20656 KB
subtask1_12.txt AC 433 ms 20668 KB
subtask1_13.txt AC 437 ms 20664 KB
subtask1_14.txt AC 437 ms 20636 KB
subtask1_15.txt AC 436 ms 20532 KB
subtask1_16.txt AC 431 ms 20532 KB
subtask1_17.txt AC 428 ms 20528 KB
subtask1_18.txt AC 431 ms 20660 KB
subtask1_19.txt AC 436 ms 20528 KB
subtask1_20.txt AC 441 ms 20532 KB