結果
問題 |
No.63 ポッキーゲーム
|
ユーザー |
![]() |
提出日時 | 2019-04-09 14:52:59 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 939 bytes |
コンパイル時間 | 819 ms |
コンパイル使用メモリ | 110,240 KB |
実行使用メモリ | 26,960 KB |
最終ジャッジ日時 | 2024-07-01 23:01:03 |
合計ジャッジ時間 | 2,275 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 WA * 4 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace No63Pokkey { class Program { static void Main(string[] args) { //整数の入力 string[] number = Console.ReadLine().Split(' '); int L = int.Parse(number[0]); int K = int.Parse(number[1]); //L/2が余る場合 double ans = 0; if (L % 2 != 0) { ans = K * ((L / K) / 2); } //L/2が余らない場合 else if (L % 2 == 0) { ans = (K * ((L / K) / 2)) - K; } //表示 if(ans <= 0) { Console.WriteLine("0"); } else { Console.WriteLine(Math.Floor(ans)); } } } }