Submission #370335
Source Code Expand
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int length = scanner.nextInt(); int status[] = new int[2401]; int i; int raining = 0; int start = 0; for(i = 0; i < length; i ++){ String[] time = scanner.next().split("-"); int _start = Integer.parseInt(time[0]); int _stop = Integer.parseInt(time[1]); _start = _start - _start%5; _stop = _stop - (_stop%5==0?0:(_stop%5-5)); status[_start] ++; status[_stop] --; } scanner.close(); for(i = 0; i < 2401; i += 5){ if(status[i] > 0){ if(raining < 1){ start = i; } raining += status[i]; }else if(status[i] < 0){ raining += status[i]; if(raining == 0){ System.out.printf("%04d-%04d\n", start, i); } } } } }
Submission Info
Submission Time | |
---|---|
Task | A - 積雪深差 |
User | ne260090 |
Language | Java (OpenJDK 1.7.0) |
Score | 0 |
Code Size | 852 Byte |
Status | RE |
Exec Time | 389 ms |
Memory | 22844 KB |
Judge Result
Set Name | all | ||||
---|---|---|---|---|---|
Score / Max Score | 0 / 100 | ||||
Status |
|
Set Name | Test Cases |
---|---|
all | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.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 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | RE | 381 ms | 22840 KB |
00_sample_02.txt | WA | 382 ms | 22712 KB |
00_sample_03.txt | RE | 380 ms | 22840 KB |
test_01.txt | WA | 379 ms | 22712 KB |
test_02.txt | RE | 381 ms | 22840 KB |
test_03.txt | WA | 382 ms | 22712 KB |
test_04.txt | RE | 389 ms | 22836 KB |
test_05.txt | RE | 388 ms | 22836 KB |
test_06.txt | RE | 384 ms | 22840 KB |
test_07.txt | RE | 383 ms | 22840 KB |
test_08.txt | RE | 383 ms | 22844 KB |
test_09.txt | RE | 382 ms | 22844 KB |
test_10.txt | RE | 382 ms | 22832 KB |
test_11.txt | RE | 379 ms | 22840 KB |
test_12.txt | RE | 380 ms | 22840 KB |
test_13.txt | RE | 383 ms | 22844 KB |
test_14.txt | RE | 384 ms | 22840 KB |
test_15.txt | RE | 383 ms | 22824 KB |
test_16.txt | RE | 382 ms | 22836 KB |
test_17.txt | RE | 383 ms | 22840 KB |