結果
問題 |
No.339 何人が回答したのか
|
ユーザー |
![]() |
提出日時 | 2025-04-09 15:06:58 |
言語 | C# (.NET 8.0.404) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,686 bytes |
コンパイル時間 | 8,698 ms |
コンパイル使用メモリ | 170,644 KB |
実行使用メモリ | 194,836 KB |
最終ジャッジ日時 | 2025-04-09 15:07:14 |
合計ジャッジ時間 | 13,591 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 60 RE * 1 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (108 ミリ秒)。 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) { int n = int.Parse(Console.ReadLine()); int[] parsentList = new int[n]; List<int> count = new List<int>(); for (int i = 0; i < n; i++) { parsentList[i] = int.Parse(Console.ReadLine()); int result = SeachCommonDivisor(parsentList[i]); if (!count.Contains(result)) { count.Add(result); } } count.Sort(); count.Reverse(); int answer = GreatestCommonDivisor(parsentList, count); Console.WriteLine(100/answer); } private static int GreatestCommonDivisor(int[] parsentList, List<int> count) { int select = 0; for(int i = 0; i < count.Count; i++) { bool okFlg = true; for(int j = 0; j < parsentList.Length; j++) { if (parsentList[j] % count[i] != 0) { okFlg = false; break; } } if (okFlg) { select = count[i]; break; } } return select; } private static int SeachCommonDivisor(int v) { int numA = 100; int numB = v; while(numA % numB != 0) { int numC = numA % numB; numA = numB; numB = numC; } return numB; } }