結果
問題 |
No.780 オフ会
|
ユーザー |
|
提出日時 | 2019-01-19 01:18:23 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 648 bytes |
コンパイル時間 | 1,216 ms |
コンパイル使用メモリ | 107,932 KB |
実行使用メモリ | 28,304 KB |
最終ジャッジ日時 | 2024-07-07 06:17:48 |
合計ジャッジ時間 | 2,434 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 23 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; class Program { static void Main(string[] args) { // 人数を読み込み var input = Console.ReadLine().Split(' '); int males = int.Parse(input[0]); int females = int.Parse(input[1]); // ペアになれなかった人数 int notPair = females - males; notPair = Math.Abs((males - females) - 1); if (notPair >= 1) { Console.WriteLine("YES"); Console.WriteLine(Math.Abs(notPair)); } else { Console.WriteLine("NO"); Console.WriteLine(Math.Abs(notPair)); } } }