結果

問題 No.358 も~っと!門松列
ユーザー NoNo
提出日時 2018-01-31 01:17:35
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 1,000 ms
コード長 883 bytes
コンパイル時間 2,069 ms
コンパイル使用メモリ 108,720 KB
実行使用メモリ 24,060 KB
最終ジャッジ日時 2023-08-28 16:45:29
合計ジャッジ時間 4,355 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
19,896 KB
testcase_01 AC 56 ms
19,900 KB
testcase_02 AC 58 ms
21,852 KB
testcase_03 AC 58 ms
23,872 KB
testcase_04 AC 59 ms
21,884 KB
testcase_05 AC 59 ms
21,748 KB
testcase_06 AC 59 ms
21,920 KB
testcase_07 AC 59 ms
22,036 KB
testcase_08 AC 60 ms
23,860 KB
testcase_09 AC 58 ms
21,844 KB
testcase_10 AC 58 ms
23,748 KB
testcase_11 AC 59 ms
21,888 KB
testcase_12 AC 58 ms
21,780 KB
testcase_13 AC 57 ms
21,856 KB
testcase_14 AC 59 ms
21,884 KB
testcase_15 AC 57 ms
19,924 KB
testcase_16 AC 57 ms
21,968 KB
testcase_17 AC 58 ms
21,772 KB
testcase_18 AC 56 ms
23,908 KB
testcase_19 AC 56 ms
21,884 KB
testcase_20 AC 58 ms
21,936 KB
testcase_21 AC 58 ms
24,060 KB
testcase_22 AC 58 ms
21,844 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.Linq;

namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            var a = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
            int cnt = 0;
            if ((a[0] < a[1] && a[1] > a[2] && a[0] != a[2]) || (a[0] > a[1] && a[1] < a[2] && a[0] != a[2]))
            {
                Console.WriteLine("INF");
            }
            else
            {
                for (int i = 2; i <= 1000; i++)
                {
                    int b1 = a[0] % i;
                    int b2 = a[1] % i;
                    int b3 = a[2] % i;
                    if ((b1 < b2 && b2 > b3 && b1 != b3) || (b1 > b2 && b2 < b3 && b1 != b3))
                    {
                        cnt++;
                    }
                }
                Console.WriteLine(cnt);
            }
        }
    }
}
0