結果

問題 No.358 も~っと!門松列
ユーザー huffman56huffman56
提出日時 2022-11-06 15:19:10
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,033 bytes
コンパイル時間 2,081 ms
コンパイル使用メモリ 105,060 KB
実行使用メモリ 23,956 KB
最終ジャッジ日時 2023-09-27 10:29:27
合計ジャッジ時間 4,896 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
23,768 KB
testcase_01 AC 59 ms
21,936 KB
testcase_02 AC 62 ms
22,024 KB
testcase_03 AC 62 ms
21,712 KB
testcase_04 AC 63 ms
21,884 KB
testcase_05 AC 63 ms
21,708 KB
testcase_06 WA -
testcase_07 AC 61 ms
21,836 KB
testcase_08 AC 61 ms
21,784 KB
testcase_09 AC 64 ms
21,836 KB
testcase_10 WA -
testcase_11 AC 61 ms
23,844 KB
testcase_12 AC 63 ms
21,952 KB
testcase_13 AC 62 ms
21,844 KB
testcase_14 AC 65 ms
21,664 KB
testcase_15 WA -
testcase_16 AC 62 ms
23,956 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 60 ms
21,724 KB
testcase_20 AC 63 ms
23,828 KB
testcase_21 WA -
testcase_22 AC 63 ms
21,868 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.Numerics;
using static System.Math;

namespace SortItems
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var a1 = n[0];
            var a2 = n[1];
            var a3 = n[2];
            var aMax = n.Max();
            var aMin = n.Min();
            var d = new Dictionary<int, int>();
            var cnt = 0;

            if (a2 == aMin)
            {
                Console.WriteLine("INF");
                return;
            }

            for (var i = 1; i <= aMax; i++)
            {

                if (a1 % i != a3 % i)
                {
                    if ((a1 % i < a2 % i && a2 % i > a3 % i) ||
                      (a1 % i > a2 % i && a2 % i < a3 % i))
                    {
                        cnt++;
                    }
                }

            }

            Console.WriteLine(cnt);
        }
    }
}
0