結果
| 問題 |
No.178 美しいWhitespace (1)
|
| コンテスト | |
| ユーザー |
nak2yoshi
|
| 提出日時 | 2016-02-23 01:26:25 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 489 bytes |
| コンパイル時間 | 1,654 ms |
| コンパイル使用メモリ | 149,248 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-12 03:00:27 |
| 合計ジャッジ時間 | 2,294 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 7 WA * 14 |
ソースコード
import std.stdio,
std.conv,
std.string,
std.range,
std.math,
std.algorithm;
void main()
{
auto N = readln.strip.to!int;
int[] a, b;
foreach (_; 0 .. N)
{
auto input = readln.split.to!(int[]);
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