結果
| 問題 | No.178 美しいWhitespace (1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-02 13:35:28 |
| 言語 | D (dmd 2.112.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 414 bytes |
| 記録 | |
| コンパイル時間 | 2,256 ms |
| コンパイル使用メモリ | 187,648 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-19 23:37:24 |
| 合計ジャッジ時間 | 2,975 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 7 WA * 14 |
コンパイルメッセージ
/home/linuxbrew/.linuxbrew/opt/dmd/include/dlang/dmd/core/checkedint.d(814): Warning: cannot inline function `core.checkedint.mulu!().mulu`
ulong mulu()(ulong x, uint y, ref bool overflow)
^
ソースコード
module main;
import std;
void main()
{
// 入力
int N = readln.chomp.to!int;
auto len = new long[](N); // 各行の幅
foreach (ref l; len) {
long a, b;
readln.chomp.formattedRead("%d %d", a, b);
l = a + 4 * b;
}
// 答えの計算と出力
long ans = 0;
long mn = len.minElement;
len[] -= mn;
foreach (l; len) {
if (l % 2) {
writeln(-1);
return;
}
ans += l / 2;
}
writeln(ans);
}