結果
問題 | No.904 サメトロ |
ユーザー |
|
提出日時 | 2019-10-11 21:25:46 |
言語 | D (dmd 2.109.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 466 bytes |
コンパイル時間 | 854 ms |
コンパイル使用メモリ | 121,848 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-22 02:45:31 |
合計ジャッジ時間 | 1,792 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 19 WA * 14 |
ソースコード
import std.stdio, std.array, std.string, std.conv, std.algorithm;import std.typecons, std.range, std.random, std.math, std.container;import std.numeric, std.bigint, core.bitop, core.stdc.string;void main() {auto N = readln.chomp.to!int;auto A = iota(N-1).map!(_ => readln.split.map!(to!int).array).array;auto x = A.map!(a => a[0]).sum;auto y = A.map!(a => a[1]).sum;int ub = y;int lb = max(0, y - x);writeln(ub - lb + 1);}