結果
| 問題 | No.959 tree and fire |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-25 00:18:53 |
| 言語 | C# (.NET 10.0.101) |
| 結果 |
AC
|
| 実行時間 | 86 ms / 2,000 ms |
| コード長 | 706 bytes |
| 記録 | |
| コンパイル時間 | 11,656 ms |
| コンパイル使用メモリ | 171,624 KB |
| 実行使用メモリ | 189,236 KB |
| 最終ジャッジ日時 | 2025-12-25 00:25:31 |
| 合計ジャッジ時間 | 15,285 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 54 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (108 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.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();
public static void Main()
{
Solve();
}
static void Solve()
{
var c = NList;
var (h, w) = (c[0], c[1]);
var p = double.Parse(ReadLine());
if (h > w) (h, w) = (w, h);
if (w == 1) WriteLine(p);
else if (h == 1) WriteLine(2 * p * p + (w - 2) * p * p * p);
else WriteLine(4 * p * p * p + (h + w - 4) * 2 * p * p * p * p + (h - 2) * (w - 2) * p * p * p * p * p);
}
}