結果
問題 | No.149 碁石の移動 |
ユーザー | mban |
提出日時 | 2016-11-07 09:54:57 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 24 ms / 2,000 ms |
コード長 | 715 bytes |
コンパイル時間 | 2,252 ms |
コンパイル使用メモリ | 109,632 KB |
実行使用メモリ | 25,996 KB |
最終ジャッジ日時 | 2024-12-24 03:21:08 |
合計ジャッジ時間 | 3,301 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 13 |
コンパイルメッセージ
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; class Magatro { static void Main() { int Aw, Ab; int Bw, Bb; int C, D; string[] s = Console.ReadLine().Split(' '); Aw = int.Parse(s[0]); Ab = int.Parse(s[1]); s = Console.ReadLine().Split(' '); Bw = int.Parse(s[0]); Bb = int.Parse(s[1]); s = Console.ReadLine().Split(' '); C = int.Parse(s[0]); D = int.Parse(s[1]); if (Ab >= C) { Ab -= C; } else { Aw -= C - Ab; Bw += C - Ab; } Aw += Math.Min(D, Bw); Console.WriteLine(Aw); } }