結果

問題 No.627 ランダムウォークの軌跡
ユーザー CroweaCrowea
提出日時 2019-01-22 19:18:52
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 715 bytes
コンパイル時間 1,021 ms
コンパイル使用メモリ 65,440 KB
実行使用メモリ 22,936 KB
最終ジャッジ日時 2023-10-14 09:11:27
合計ジャッジ時間 4,496 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
18,636 KB
testcase_01 WA -
testcase_02 AC 54 ms
22,700 KB
testcase_03 AC 54 ms
22,832 KB
testcase_04 AC 55 ms
22,736 KB
testcase_05 AC 53 ms
20,736 KB
testcase_06 AC 54 ms
18,784 KB
testcase_07 AC 54 ms
20,772 KB
testcase_08 AC 54 ms
20,752 KB
testcase_09 WA -
testcase_10 AC 55 ms
22,744 KB
testcase_11 AC 55 ms
20,768 KB
testcase_12 AC 54 ms
18,648 KB
testcase_13 WA -
testcase_14 AC 55 ms
20,724 KB
testcase_15 WA -
testcase_16 AC 55 ms
20,676 KB
testcase_17 AC 53 ms
20,760 KB
testcase_18 AC 55 ms
22,936 KB
testcase_19 WA -
testcase_20 AC 55 ms
20,692 KB
testcase_21 AC 55 ms
20,680 KB
testcase_22 AC 54 ms
20,772 KB
testcase_23 WA -
testcase_24 AC 55 ms
22,680 KB
testcase_25 AC 55 ms
22,772 KB
testcase_26 AC 54 ms
20,732 KB
testcase_27 WA -
testcase_28 AC 55 ms
18,720 KB
testcase_29 WA -
testcase_30 AC 54 ms
20,784 KB
testcase_31 AC 55 ms
22,704 KB
testcase_32 AC 54 ms
20,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        var T = int.Parse(Console.ReadLine());
        var list = new List<int> { 0 };
        bool isRandomWalk = false;

        int x;
        for (int i=0; i<T; i++)
        {
            x = int.Parse(Console.ReadLine());
            if (x == list[0]) break;
            list.Add(x);
        }

        int pos;
        for (int j=0; j<list.Count -1; j++)
        {
            pos = Math.Abs(list[j + 1] - list[j]);
            isRandomWalk = (1 <= pos && pos < 2) ? true : false;
            if (!isRandomWalk) break;
        }

        Console.WriteLine((isRandomWalk == true) ? "T" : "F");
    }
}

0