結果
| 問題 | No.178 美しいWhitespace (1) |
| コンテスト | |
| ユーザー |
kokatsu
|
| 提出日時 | 2022-02-08 20:59:21 |
| 言語 | D (dmd 2.112.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 419 bytes |
| 記録 | |
| コンパイル時間 | 1,237 ms |
| コンパイル使用メモリ | 191,740 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2026-03-06 19:19:04 |
| 合計ジャッジ時間 | 2,238 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 21 |
コンパイルメッセージ
/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)
^
ソースコード
import std;
void main() {
int N;
readf("%d\n", N);
auto S = new long[](N);
foreach (ref s; S) {
long a, b;
readf("%d %d\n", a, b);
s = a + b * 4;
}
S.sort!"a > b";
long res, W = S.front;
foreach (s; S) {
long num = W - s;
if (num % 2 == 1) {
res = -1;
break;
}
res += num / 2;
}
res.writeln;
}
kokatsu