結果
問題 | No.312 置換処理 |
ユーザー |
|
提出日時 | 2023-07-31 10:20:50 |
言語 | C# (.NET 8.0.404) |
結果 |
AC
|
実行時間 | 71 ms / 2,000 ms |
コード長 | 793 bytes |
コンパイル時間 | 7,238 ms |
コンパイル使用メモリ | 168,176 KB |
実行使用メモリ | 185,416 KB |
最終ジャッジ日時 | 2024-10-10 04:02:22 |
合計ジャッジ時間 | 11,025 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 45 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (92 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 yukicoder { public class Program { public static void Main() { var n = long.Parse(Console.ReadLine()); var c = true; for(var i = 3; i <= (long)Math.Floor(Math.Sqrt(n)); i++) { if (n % i == 0) { Console.WriteLine(i); c = false; break; } } if (c) { if (n % 2 == 0&&n/2>2) { Console.WriteLine(n / 2); } else { Console.WriteLine(n); } } } } }