这是我的代码,它在VS 2022中运行良好,但当我试图在CodeForces中提交它时,我得到了一个运行时错误。
我该怎么解决呢????
using System;
class Program
{
public static void Main(string[] args)
{
string? Val1 = Console.ReadLine();
int Number1 = Convert.ToInt32(Val1);
string? Val2 = Console.ReadLine();
int Number2 = Convert.ToInt32(Val2);
if (Number2 <= (Number1 + 1) / 2)
{
Console.WriteLine(Number2 * 2 - 1);
}
else
{
Console.WriteLine((Number2 - (Number1 + 1) / 2) * 2);
}
}
}
1条答案
按热度按时间dly7yett1#