結果
| 問題 |
No.178 美しいWhitespace (1)
|
| コンテスト | |
| ユーザー |
nak2yoshi
|
| 提出日時 | 2016-02-23 01:34:46 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 2,000 ms |
| コード長 | 491 bytes |
| コンパイル時間 | 1,799 ms |
| コンパイル使用メモリ | 150,888 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-12 03:00:30 |
| 合計ジャッジ時間 | 2,409 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 |
ソースコード
import std.stdio,
std.conv,
std.string,
std.range,
std.math,
std.algorithm;
void main()
{
auto N = readln.strip.to!int;
long[] a, b;
foreach (_; 0 .. N)
{
auto input = readln.split.to!(long[]);
a ~= input[0];
b ~= input[1];
}
auto widths = zip(a, b).map!"a[0]+4*a[1]";
auto diffs = widths.map!(diff => widths.minPos!"a>b".front-diff);
(diffs.filter!"a%2==1".empty ? diffs.sum / 2 : -1).writeln;
}
nak2yoshi