Submission #108580
Source Code Expand
using System; using System.IO; using System.Collections.Generic; using System.Linq; using System.Text; public class Program { static public long DivLower(long x, long y) { if (y < 0) return DivLower(-x, -y); if (x >= 0) return x / y; return x / y - (x % y == 0 ? 0 : 1); } static public long DivUpper(long x, long y) { if (y < 0) return DivUpper(-x, -y); if (x <= 0) return x / y; return x / y + (x % y == 0 ? 0 : 1); } public static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); var data = Enumerable.Range(0, N) .Select(_ => Console.ReadLine()) .Select(s => s.Split(new[] { '-' })) .Select(a => new { from = DivLower(int.Parse(a[0]), 5) * 5, to = DivUpper(int.Parse(a[1]), 5) * 5 }) .OrderBy(v => v.from) .ThenBy(v => v.to) .ToArray(); for (int i = 0; i < data.Length; ) { long minTime = data[i].from; long maxTime = data[i].to; int j = i; while (j + 1 < data.Length && data[j + 1].from <= maxTime) { maxTime = Math.Max(data[j + 1].to, maxTime); j++; } Console.WriteLine(String.Format("{0:0000}-{1:0000}", minTime, maxTime)); i = j + 1; } } }
Submission Info
Submission Time | |
---|---|
Task | D - 感雨時刻の整理 |
User | EmK |
Language | C# (Mono 2.10.8.1) |
Score | 0 |
Code Size | 1407 Byte |
Status | WA |
Exec Time | 309 ms |
Memory | 12564 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, 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 | 185 ms | 9148 KB |
00_sample_02.txt | AC | 185 ms | 9212 KB |
00_sample_03.txt | AC | 185 ms | 9216 KB |
cho_cho_chokudai.txt | WA | 256 ms | 12232 KB |
chokudai_ga_cho.txt | AC | 262 ms | 12556 KB |
test_01.txt | AC | 193 ms | 9336 KB |
test_02.txt | AC | 191 ms | 9348 KB |
test_03.txt | AC | 225 ms | 9300 KB |
test_04.txt | AC | 191 ms | 9340 KB |
test_05.txt | AC | 196 ms | 9280 KB |
test_06.txt | AC | 184 ms | 9232 KB |
test_07.txt | AC | 253 ms | 9152 KB |
test_08.txt | AC | 198 ms | 9216 KB |
test_09.txt | AC | 191 ms | 9284 KB |
test_10.txt | AC | 182 ms | 9228 KB |
test_11.txt | AC | 189 ms | 9236 KB |
test_12.txt | AC | 187 ms | 9228 KB |
test_13.txt | AC | 180 ms | 9220 KB |
test_14.txt | AC | 181 ms | 9268 KB |
test_15.txt | AC | 192 ms | 9392 KB |
test_16.txt | AC | 206 ms | 9224 KB |
test_17.txt | AC | 217 ms | 9220 KB |
test_18.txt | AC | 182 ms | 9340 KB |
test_19.txt | AC | 190 ms | 9356 KB |
test_20.txt | AC | 185 ms | 9340 KB |
test_21.txt | AC | 282 ms | 12556 KB |
test_22.txt | AC | 254 ms | 12552 KB |
test_23.txt | AC | 253 ms | 12296 KB |
test_24.txt | AC | 251 ms | 12560 KB |
test_25.txt | AC | 250 ms | 12408 KB |
test_26.txt | WA | 250 ms | 12228 KB |
test_27.txt | AC | 256 ms | 12552 KB |
test_28.txt | WA | 253 ms | 12300 KB |
test_29.txt | AC | 197 ms | 9212 KB |
test_30.txt | WA | 196 ms | 9160 KB |
test_31.txt | WA | 195 ms | 9600 KB |
test_32.txt | AC | 186 ms | 9220 KB |
test_33.txt | WA | 230 ms | 11584 KB |
test_34.txt | AC | 183 ms | 9156 KB |
test_35.txt | WA | 293 ms | 9216 KB |
test_36.txt | AC | 251 ms | 12428 KB |
test_37.txt | WA | 260 ms | 12548 KB |
test_38.txt | WA | 267 ms | 12424 KB |
test_39.txt | AC | 254 ms | 12416 KB |
test_40.txt | WA | 253 ms | 12424 KB |
test_41.txt | AC | 253 ms | 12472 KB |
test_42.txt | AC | 309 ms | 12564 KB |
test_43.txt | AC | 257 ms | 12448 KB |