結果
問題 | No.358 も~っと!門松列 |
ユーザー |
|
提出日時 | 2016-05-10 22:37:02 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 25 ms / 1,000 ms |
コード長 | 1,193 bytes |
コンパイル時間 | 802 ms |
コンパイル使用メモリ | 112,588 KB |
実行使用メモリ | 27,092 KB |
最終ジャッジ日時 | 2024-10-05 13:34:55 |
合計ジャッジ時間 | 2,237 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace YukiCoder { class Program { static void Main() { int[] A = new int[3]; string s = Console.ReadLine(); for(int i = 0; i < 3; i++) { A[i] = int.Parse(s.Split(' ')[i]); } if (A[0] == A[1] || A[1] == A[2] || A[0] == A[2]) { Console.WriteLine(0); } else if (A.Min() == A[1] || A.Max() == A[1]) { Console.WriteLine("INF"); } else { int count = 0; for(int i = 1; i <= A.Max(); i++) { int[] b = new int[3]; for(int j = 0; j < 3; j++) { b[j] = A[j] % i; } if (!(b[0] == b[1] || b[1] == b[2] || b[0] == b[2])) { if (b.Min() == b[1] || b.Max() == b[1]) { count++; } } } Console.WriteLine(count); } } } }