結果

問題 No.358 も~っと!門松列
ユーザー NoNo
提出日時 2018-01-31 01:16:53
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 882 bytes
コンパイル時間 3,462 ms
コンパイル使用メモリ 106,940 KB
実行使用メモリ 23,976 KB
最終ジャッジ日時 2023-08-28 16:45:09
合計ジャッジ時間 5,775 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
21,884 KB
testcase_01 AC 58 ms
23,848 KB
testcase_02 AC 60 ms
23,748 KB
testcase_03 AC 58 ms
19,692 KB
testcase_04 AC 58 ms
21,872 KB
testcase_05 AC 59 ms
23,976 KB
testcase_06 AC 58 ms
21,804 KB
testcase_07 AC 58 ms
21,872 KB
testcase_08 AC 58 ms
21,956 KB
testcase_09 AC 59 ms
23,884 KB
testcase_10 AC 59 ms
21,760 KB
testcase_11 AC 58 ms
21,736 KB
testcase_12 AC 58 ms
21,672 KB
testcase_13 AC 58 ms
21,764 KB
testcase_14 AC 59 ms
21,808 KB
testcase_15 AC 58 ms
21,912 KB
testcase_16 AC 58 ms
21,796 KB
testcase_17 AC 58 ms
21,824 KB
testcase_18 AC 57 ms
23,952 KB
testcase_19 AC 56 ms
19,704 KB
testcase_20 AC 58 ms
21,908 KB
testcase_21 AC 56 ms
21,876 KB
testcase_22 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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