Submission #1003500
Source Code Expand
import std.stdio; import std.string; import std.conv; import std.typecons; import std.algorithm; import std.functional; import std.bigint; import std.numeric; import std.array; import std.math; import std.range; import std.container; import std.ascii; import std.traits; void times(alias fun)(int n) { foreach(i; 0..n) fun(); } auto rep(alias fun, T = typeof(fun()))(int n) { T[] res = new T[n]; foreach(ref e; res) e = fun(); return res; } // fold was added in D 2.071.0. template fold(fun...) if (fun.length >= 1) { auto fold(R, S...)(R r, S seed) { static if (S.length < 2) { return reduce!fun(seed, r); } else { return reduce!fun(tuple(seed), r); } } } int MAX = 10^^6+1; void main() { int N = readln.chomp.to!int; int[] a = readln.split.to!(int[]); auto list = DList!int(MAX.iota); iota(2, N-1).each!(i => list[].drop(1).take(a[i]).each!(v => list.insertFront(v))); int M = readln.chomp.to!int; foreach(_; 0..M) { int x = readln.chomp.to!int; writeln(list[].drop(x).front + a[0] - a[1]); } }
Submission Info
Submission Time | |
---|---|
Task | H - Tokaido |
User | arkark |
Language | D (DMD64 v2.070.1) |
Score | 0 |
Code Size | 1161 Byte |
Status | TLE |
Exec Time | 2106 ms |
Memory | 69620 KB |
Judge Result
Set Name | sample | dataset1 | dataset2 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 700 | 0 / 900 | ||||||||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
sample | sample-01.txt, sample-02.txt |
dataset1 | sample-01.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt |
dataset2 | sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 01-11.txt, 01-12.txt, 01-13.txt, 01-14.txt, 01-15.txt, 01-16.txt, 01-17.txt, 01-18.txt, 01-19.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt, 02-09.txt, 02-10.txt, 02-11.txt, 02-12.txt, 02-13.txt, 02-14.txt, 02-15.txt, 02-16.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | RE | 471 ms | 69228 KB |
01-02.txt | AC | 143 ms | 32636 KB |
01-03.txt | AC | 327 ms | 64892 KB |
01-04.txt | AC | 342 ms | 66940 KB |
01-05.txt | AC | 386 ms | 69612 KB |
01-06.txt | AC | 384 ms | 69612 KB |
01-07.txt | AC | 341 ms | 66044 KB |
01-08.txt | AC | 384 ms | 69596 KB |
01-09.txt | AC | 385 ms | 69596 KB |
01-10.txt | AC | 301 ms | 64892 KB |
01-11.txt | AC | 333 ms | 65788 KB |
01-12.txt | AC | 382 ms | 69380 KB |
01-13.txt | AC | 383 ms | 69620 KB |
01-14.txt | AC | 386 ms | 69496 KB |
01-15.txt | AC | 387 ms | 69620 KB |
01-16.txt | AC | 382 ms | 69620 KB |
01-17.txt | AC | 192 ms | 36980 KB |
01-18.txt | RE | 287 ms | 36852 KB |
01-19.txt | AC | 191 ms | 36980 KB |
02-01.txt | RE | 421 ms | 64764 KB |
02-02.txt | RE | 473 ms | 69228 KB |
02-03.txt | TLE | 2106 ms | 69228 KB |
02-04.txt | TLE | 2106 ms | 69228 KB |
02-05.txt | TLE | 2106 ms | 63868 KB |
02-06.txt | TLE | 2106 ms | 69340 KB |
02-07.txt | TLE | 2106 ms | 69340 KB |
02-08.txt | TLE | 2106 ms | 63868 KB |
02-09.txt | TLE | 2106 ms | 63996 KB |
02-10.txt | TLE | 2106 ms | 66172 KB |
02-11.txt | TLE | 2106 ms | 69236 KB |
02-12.txt | TLE | 2106 ms | 69244 KB |
02-13.txt | TLE | 2106 ms | 69236 KB |
02-14.txt | TLE | 2106 ms | 69236 KB |
02-15.txt | TLE | 2104 ms | 36852 KB |
02-16.txt | TLE | 2104 ms | 36980 KB |
sample-01.txt | AC | 139 ms | 32636 KB |
sample-02.txt | AC | 140 ms | 32636 KB |