結果
問題 | No.2358 xy+yz+zx=N |
ユーザー | Adamantite |
提出日時 | 2023-06-25 03:26:04 |
言語 | C# (.NET 8.0.203) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,127 bytes |
コンパイル時間 | 12,429 ms |
コンパイル使用メモリ | 145,184 KB |
実行使用メモリ | 165,044 KB |
最終ジャッジ日時 | 2023-09-14 23:25:00 |
合計ジャッジ時間 | 10,227 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 53 ms
28,844 KB |
testcase_01 | WA | - |
testcase_02 | AC | 54 ms
29,096 KB |
testcase_03 | WA | - |
testcase_04 | AC | 53 ms
30,796 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
コンパイルメッセージ
Determining projects to restore... Restored /home/judge/data/code/main.csproj (in 131 ms). .NET 向け Microsoft (R) Build Engine バージョン 17.0.0-preview-21470-01+cb055d28f Copyright (C) Microsoft Corporation.All rights reserved. プレビュー版の .NET を使用しています。https://aka.ms/dotnet-core-preview をご覧ください main -> /home/judge/data/code/bin/Release/net6.0/main.dll main -> /home/judge/data/code/bin/Release/net6.0/publish/
ソースコード
using System; using System.Collections.Generic; using System.Linq; namespace B_xy_yz_zx_N { internal class Program { static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); List<string> list = new List<string>(); int x = 0; while (x * x <= n) { int y = x; while(y * y <= n) { if (x + y == 0) { y++; continue; } int a = x * y; int b = x + y; if ((n - a) % b == 0) { int z = (n - a) / b; if (x == y && y == z) { list.Add(string.Format("{0} {1} {2}", x, y, z)); } else if (x == y) { list.Add(string.Format("{0} {1} {2}", x, y, z)); list.Add(string.Format("{0} {1} {2}", x, z, y)); list.Add(string.Format("{0} {1} {2}", z, x, y)); } else if (y == z) { list.Add(string.Format("{0} {1} {2}", x, y, z)); list.Add(string.Format("{0} {1} {2}", y, x, z)); list.Add(string.Format("{0} {1} {2}", y, z, x)); } else { list.Add(string.Format("{0} {1} {2}", x, y, z)); list.Add(string.Format("{0} {1} {2}", x, z, y)); list.Add(string.Format("{0} {1} {2}", y, x, z)); list.Add(string.Format("{0} {1} {2}", y, z, x)); list.Add(string.Format("{0} {1} {2}", z, x, y)); list.Add(string.Format("{0} {1} {2}", z, y, x)); } } y++; } x++; } Console.WriteLine(list.Count); foreach (string s in list) { Console.WriteLine(s); } } } }