結果
| 問題 |
No.2358 xy+yz+zx=N
|
| コンテスト | |
| ユーザー |
Adamantite
|
| 提出日時 | 2023-06-25 03:09:54 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,999 bytes |
| コンパイル時間 | 8,111 ms |
| コンパイル使用メモリ | 166,568 KB |
| 実行使用メモリ | 43,296 KB |
| 最終ジャッジ日時 | 2024-07-02 05:26:14 |
| 合計ジャッジ時間 | 12,784 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 4 WA * 1 TLE * 1 -- * 4 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (99 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.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>();
for (int x = 0; x <= n / 8 + 1; x++) {
for (int y = x; y <= n / 4 + 1; y++) {
if (y == 0) {
continue;
}
int a = x * y;
int b = x + y;
if ((n - a) % b == 0) {
int z = (n - a) / b;
if (z < y) {
break;
}
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));
}
}
}
}
Console.WriteLine(list.Count);
foreach (string s in list) {
Console.WriteLine(s);
}
}
}
}
Adamantite