結果
問題 |
No.1940 Escape through + -
|
ユーザー |
![]() |
提出日時 | 2025-04-10 09:31:44 |
言語 | C# (.NET 8.0.404) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,024 bytes |
コンパイル時間 | 8,239 ms |
コンパイル使用メモリ | 173,804 KB |
実行使用メモリ | 208,440 KB |
最終ジャッジ日時 | 2025-04-10 09:31:55 |
合計ジャッジ時間 | 11,254 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 18 WA * 7 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (104 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
class Program { static void Main(string[] args) { string[] str = Console.ReadLine().Split(' '); string[] numList = Console.ReadLine().Split(' '); decimal judgeNum = RemainderScore(numList, decimal.Parse(str[2])); if (judgeNum < 0 && judgeNum % decimal.Parse(str[1]) != 0) { Console.WriteLine("No"); } else { Console.WriteLine("Yes"); } } /// <summary> /// 目標数字-数字一覧[i]を繰り返して余りを返す /// </summary> /// <param name="numList">数字一覧</param> /// <param name="v">最終目標数字</param> /// <returns></returns> private static decimal RemainderScore(string[] numList, decimal v) { for(int i = 0; i < numList.Length; i++) { v -= decimal.Parse(numList[i]); } return v; } }