結果
問題 | No.1446 ハンバーグと納豆ごはん |
ユーザー |
![]() |
提出日時 | 2021-03-31 22:56:43 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 25 ms / 2,000 ms |
コード長 | 551 bytes |
コンパイル時間 | 4,909 ms |
コンパイル使用メモリ | 102,656 KB |
実行使用メモリ | 17,920 KB |
最終ジャッジ日時 | 2024-12-15 21:32:49 |
合計ジャッジ時間 | 5,990 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 33 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;public class Hello{public static long a, b, n, m;static void Main(){string[] line = Console.ReadLine().Trim().Split(' ');a = long.Parse(line[0]);b = long.Parse(line[1]);n = long.Parse(line[2]);m = long.Parse(line[3]);getAns();}static void getAns(){if (a == b) { Console.WriteLine(a); return; }long ans;if (a > b) ans = b + (a - b) / (n + 1);else ans = a + (b - a) / (m + 1);Console.WriteLine(ans);}}