結果
問題 | No.1860 Magnets |
ユーザー |
|
提出日時 | 2022-03-04 22:29:02 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 26 ms / 2,000 ms |
コード長 | 631 bytes |
コンパイル時間 | 2,267 ms |
コンパイル使用メモリ | 106,880 KB |
実行使用メモリ | 19,072 KB |
最終ジャッジ日時 | 2024-07-18 20:59:59 |
合計ジャッジ時間 | 3,324 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 28 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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 long[][] NArr(int n) => Enumerable.Repeat(0, n).Select(_ => NList).ToArray();static void Main(){var c = NList;var (a, b) = (c[0], c[1]);if (Math.Abs(a - b) > 1){var d = Math.Abs(a - b) - 1;WriteLine(a + b + d);}else{WriteLine(a + b);}}}