結果

問題 No.1446 ハンバーグと納豆ごはん
コンテスト
ユーザー AAAAAA
提出日時 2021-03-31 15:38:27
言語 C#(csc)
(csc 3.9.0)
コンパイル:
csc -langversion:latest -unsafe -warn:0 -o+ /r:System.Numerics.dll _filename_ -out:a.exe
実行:
/usr/bin/mono a.exe
結果
WA  
実行時間 -
コード長 898 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 564 ms
コンパイル使用メモリ 103,936 KB
実行使用メモリ 23,552 KB
最終ジャッジ日時 2026-05-25 15:53:23
合計ジャッジ時間 4,681 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other AC * 1 WA * 6 TLE * 1 -- * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #
raw source code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp188
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = (Console.ReadLine().Split());
            long a=long.Parse(str[0]);
            long b = long.Parse(str[1]);
            long n = long.Parse(str[2]);
            long m = long.Parse(str[3]);
            long e = 0;
            if (a / n >= b )
            {
                while (a - e*n >= b + e)
                {
                    e += 1;
                }
                Console.WriteLine(a - e * n);
            }
            else
            {
                while (b - e * m >= a + e)
                {
                    e += 1;
                }
                Console.WriteLine(b - e * m);
            }
            

        }
    }
}
0