結果

問題 No.780 オフ会
ユーザー bluemeganebluemegane
提出日時 2019-01-16 12:24:12
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 502 bytes
コンパイル時間 1,941 ms
コンパイル使用メモリ 101,728 KB
実行使用メモリ 22,928 KB
最終ジャッジ日時 2023-09-09 23:50:29
合計ジャッジ時間 4,838 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
20,792 KB
testcase_01 AC 60 ms
20,772 KB
testcase_02 AC 56 ms
22,620 KB
testcase_03 AC 60 ms
20,764 KB
testcase_04 AC 60 ms
22,712 KB
testcase_05 AC 59 ms
22,692 KB
testcase_06 AC 59 ms
20,656 KB
testcase_07 AC 59 ms
18,568 KB
testcase_08 AC 59 ms
20,612 KB
testcase_09 AC 60 ms
20,604 KB
testcase_10 AC 61 ms
22,664 KB
testcase_11 AC 60 ms
20,744 KB
testcase_12 AC 61 ms
20,760 KB
testcase_13 AC 60 ms
22,808 KB
testcase_14 AC 61 ms
22,928 KB
testcase_15 AC 60 ms
20,780 KB
testcase_16 AC 59 ms
20,828 KB
testcase_17 AC 60 ms
20,572 KB
testcase_18 AC 60 ms
22,704 KB
testcase_19 AC 58 ms
18,644 KB
testcase_20 AC 60 ms
20,748 KB
testcase_21 AC 59 ms
20,768 KB
testcase_22 AC 61 ms
22,580 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using static System.Math;
using System;

public class Hello
{
    static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var a = int.Parse(line[0]);
        var b = int.Parse(line[1]);
        var w = a + b + 1 - Min(a + 1, b) * 2;
        if (w == 0) { Console.WriteLine("YES\n0"); }
        else if (a == b) { Console.WriteLine("NO\n1"); }
        else if (a < b) { Console.WriteLine("YES\n{0}",w); }
        else { Console.WriteLine("NO\n{0}", w); }
    }
}

0