結果

問題 No.358 も~っと!門松列
ユーザー mban259mban259
提出日時 2016-05-10 22:37:02
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 30 ms / 1,000 ms
コード長 1,193 bytes
コンパイル時間 887 ms
コンパイル使用メモリ 105,728 KB
実行使用メモリ 19,072 KB
最終ジャッジ日時 2024-04-15 15:07:05
合計ジャッジ時間 2,282 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
18,688 KB
testcase_01 AC 27 ms
18,944 KB
testcase_02 AC 27 ms
18,944 KB
testcase_03 AC 26 ms
18,560 KB
testcase_04 AC 29 ms
19,072 KB
testcase_05 AC 30 ms
19,072 KB
testcase_06 AC 27 ms
18,816 KB
testcase_07 AC 27 ms
18,560 KB
testcase_08 AC 25 ms
18,560 KB
testcase_09 AC 29 ms
18,944 KB
testcase_10 AC 25 ms
18,560 KB
testcase_11 AC 27 ms
18,816 KB
testcase_12 AC 27 ms
18,560 KB
testcase_13 AC 28 ms
18,944 KB
testcase_14 AC 27 ms
18,944 KB
testcase_15 AC 26 ms
18,816 KB
testcase_16 AC 26 ms
18,688 KB
testcase_17 AC 26 ms
18,816 KB
testcase_18 AC 27 ms
18,816 KB
testcase_19 AC 28 ms
18,816 KB
testcase_20 AC 27 ms
19,072 KB
testcase_21 AC 28 ms
18,944 KB
testcase_22 AC 27 ms
19,072 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

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);
            }
        }
    }
}
0