Submission #170931


Source Code Expand

import java.util.Arrays;
import java.util.Scanner;

public class Main {
	static Scanner sc=new Scanner(System.in);
	
	public static void main(String[] args){
		int n=sc.nextInt();
		int[][] time=new int[n][2];
		boolean[] ans=new boolean[24*60+6]; 
		String s;
		for(int i=0;i<n;i++){
			s=sc.next();
			time[i][0]=(SI(s.split("-")[0])/100*60) + SI(s.split("-")[0].substring(2,4));
			time[i][0]-=time[i][0]%5;
			time[i][1]=(SI(s.split("-")[1])/100*60) + SI(s.split("-")[1].substring(2,4));
			if(time[i][1]%5!=0)time[i][1]+=5-(time[i][1]%5);
		}
		
		for(int i=0;i<n;i++){
			for(int i2=time[i][0];i2<=time[i][1];i2++){
				ans[i2]=true;
			}
		}
		
		for(int i=0;i<24*60+1;i+=5){
			if(ans[i]){
				System.out.print(String.format("%1$02d", i/60)+""+String.format("%1$02d", i%60)+"-");
				while(ans[i])i++;
				i--;
				System.out.println(String.format("%1$02d", (i)/60)+""+String.format("%1$02d", (i)%60));
			}
		}
		
	}
	
	static int SI(String a) {
		return Integer.parseInt(a);
	}

	static char SC(String a) {
		return a.charAt(0);
	}

	static double SD(String a) {
		return new Double(a).doubleValue();
	}

	static String CS(char a) {
		return String.valueOf(a);
	}

	static int DI(double a) {
		return new Double(a).intValue();
	}

	static String DS(double a) {
		return Double.toString(a);
	}

	static int LI(long a) {
		return new Long(a).intValue();
	}

	static char LC(long a) {
		return Long.toString(a).charAt(0);
	}

	static double LD(long a) {
		return new Long(a).doubleValue();
	}

	static long IL(int a) {
		return new Integer(a).longValue();
	}

	static double ID(int a) {
		return new Integer(a).doubleValue();
	}

	static char IC(int a) {
		return Integer.toString(a).charAt(0);
	}

	static String IS(int a) {
		return Integer.toString(a);
	}

}

Submission Info

Submission Time
Task D - 感雨時刻の整理
User spin13
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 1856 Byte
Status AC
Exec Time 1005 ms
Memory 40976 KB

Judge Result

Set Name all
Score / Max Score 100 / 100
Status
AC × 48
Set Name Test Cases
all 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, cho_cho_chokudai.txt, chokudai_ga_cho.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt, test_29.txt, test_30.txt, test_31.txt, test_32.txt, test_33.txt, test_34.txt, test_35.txt, test_36.txt, test_37.txt, test_38.txt, test_39.txt, test_40.txt, test_41.txt, test_42.txt, test_43.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 480 ms 22660 KB
00_sample_02.txt AC 467 ms 22556 KB
00_sample_03.txt AC 433 ms 22544 KB
cho_cho_chokudai.txt AC 1005 ms 40976 KB
chokudai_ga_cho.txt AC 910 ms 40736 KB
test_01.txt AC 514 ms 23824 KB
test_02.txt AC 511 ms 23664 KB
test_03.txt AC 515 ms 23700 KB
test_04.txt AC 515 ms 23692 KB
test_05.txt AC 533 ms 23828 KB
test_06.txt AC 499 ms 23700 KB
test_07.txt AC 465 ms 23320 KB
test_08.txt AC 471 ms 23184 KB
test_09.txt AC 541 ms 24076 KB
test_10.txt AC 549 ms 24320 KB
test_11.txt AC 547 ms 24068 KB
test_12.txt AC 500 ms 23696 KB
test_13.txt AC 486 ms 23316 KB
test_14.txt AC 539 ms 24080 KB
test_15.txt AC 540 ms 24336 KB
test_16.txt AC 466 ms 23224 KB
test_17.txt AC 544 ms 24196 KB
test_18.txt AC 488 ms 23312 KB
test_19.txt AC 520 ms 23576 KB
test_20.txt AC 527 ms 24084 KB
test_21.txt AC 918 ms 40772 KB
test_22.txt AC 911 ms 39776 KB
test_23.txt AC 933 ms 40852 KB
test_24.txt AC 893 ms 39892 KB
test_25.txt AC 933 ms 40728 KB
test_26.txt AC 960 ms 40608 KB
test_27.txt AC 926 ms 40508 KB
test_28.txt AC 913 ms 39940 KB
test_29.txt AC 447 ms 22724 KB
test_30.txt AC 455 ms 22804 KB
test_31.txt AC 723 ms 33228 KB
test_32.txt AC 445 ms 22668 KB
test_33.txt AC 873 ms 38924 KB
test_34.txt AC 437 ms 22544 KB
test_35.txt AC 629 ms 23320 KB
test_36.txt AC 997 ms 40896 KB
test_37.txt AC 883 ms 39992 KB
test_38.txt AC 895 ms 40400 KB
test_39.txt AC 973 ms 40932 KB
test_40.txt AC 893 ms 40804 KB
test_41.txt AC 953 ms 40520 KB
test_42.txt AC 965 ms 40676 KB
test_43.txt AC 915 ms 40128 KB