結果
| 問題 | No.511 落ちゲー 〜手作業のぬくもり〜 |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2026-11-14 20:26:13 |
| 言語 | C# (.NET 10.0.403 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 249 ms / 4,000 ms |
| + 749µs | |
| コード長 | 1,718 bytes |
| 記録 | |
| コンパイル時間 | 5,374 ms |
| コンパイル使用メモリ | 166,376 KB |
| 実行使用メモリ | 58,140 KB |
| 最終ジャッジ日時 | 2026-11-14 20:26:25 |
| 合計ジャッジ時間 | 11,708 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 32 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (179 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net10.0/main.dll main -> /home/judge/data/code/bin/Release/net10.0/publish/
ソースコード
using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
class Program
{
static int NN => int.Parse(ReadLine());
static long[] NList => ReadLine().Split().Select(long.Parse).ToArray();
static string[] SList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => ReadLine()).ToArray();
public static void Main()
{
Solve();
}
static void Solve()
{
var c = NList;
var (n, w, h) = (c[0], (int)c[1], c[2]);
var init = new long[w];
var seg = new AtCoder.LazySegtree<long, long, SegOp>(init);
var apt = 0;
var bpt = 0;
for (var i = 0; i < n; ++i)
{
c = NList;
var (a, b, x) = ((int)c[0], (int)c[1], (int)c[2] - 1);
seg.Apply(x, x + a, b);
while (true)
{
var pos = seg.MaxRight(x, hi => hi < h);
if (pos >= x + a) break;
if (i % 2 == 0) ++apt;
else ++bpt;
seg[pos] = INF;
}
}
WriteLine(apt == bpt ? "DRAW" : apt > bpt ? "A" : "B");
}
static long INF = long.MinValue + 1;
struct SegOp : AtCoder.ILazySegtreeOperator<long, long>
{
public long Identity => long.MinValue;
public long FIdentity => 0;
public long Composition(long nf, long cf)
{
return nf + cf;
}
public long Mapping(long f, long x)
{
if (x == INF) return x;
return f + x;
}
public long Operate(long x, long y)
{
return Math.Max(x, y);
}
}
}