結果
| 問題 |
No.2194 兄弟の掛け引き
|
| コンテスト | |
| ユーザー |
bluemegane
|
| 提出日時 | 2023-01-20 22:42:34 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 28 ms / 1,000 ms |
| コード長 | 586 bytes |
| コンパイル時間 | 797 ms |
| コンパイル使用メモリ | 109,660 KB |
| 実行使用メモリ | 26,288 KB |
| 最終ジャッジ日時 | 2024-06-23 10:40:18 |
| 合計ジャッジ時間 | 1,932 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using static System.Math;
using System.Collections.Generic;
using System.Linq;
using System;
public class Hello
{
static void Main()
{
string[] line = Console.ReadLine().Trim().Split(' ');
var a = int.Parse(line[0]);
var b = int.Parse(line[1]);
var c = int.Parse(line[2]);
var ans = new List<int>();
if ((b + c) % a == 0) ans.Add((b + c) / a);
if (c % a == 0 && c <= b) ans.Add(c / a);
ans.Sort();
if (ans.Count == 0) Console.WriteLine(-1);
else Console.WriteLine(string.Join("\n", ans));
}
}
bluemegane