結果

問題 No.627 ランダムウォークの軌跡
ユーザー CroweaCrowea
提出日時 2019-01-22 19:24:46
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 52 ms / 2,000 ms
コード長 711 bytes
コンパイル時間 919 ms
コンパイル使用メモリ 63,644 KB
実行使用メモリ 22,804 KB
最終ジャッジ日時 2023-10-14 09:13:19
合計ジャッジ時間 3,959 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
20,744 KB
testcase_01 AC 49 ms
20,544 KB
testcase_02 AC 46 ms
18,700 KB
testcase_03 AC 47 ms
20,664 KB
testcase_04 AC 46 ms
18,812 KB
testcase_05 AC 51 ms
20,668 KB
testcase_06 AC 46 ms
20,864 KB
testcase_07 AC 47 ms
20,696 KB
testcase_08 AC 48 ms
20,536 KB
testcase_09 AC 48 ms
20,884 KB
testcase_10 AC 49 ms
22,796 KB
testcase_11 AC 48 ms
20,808 KB
testcase_12 AC 49 ms
20,688 KB
testcase_13 AC 52 ms
20,944 KB
testcase_14 AC 46 ms
20,676 KB
testcase_15 AC 45 ms
20,744 KB
testcase_16 AC 45 ms
20,680 KB
testcase_17 AC 45 ms
20,752 KB
testcase_18 AC 49 ms
22,720 KB
testcase_19 AC 48 ms
20,608 KB
testcase_20 AC 47 ms
20,732 KB
testcase_21 AC 47 ms
20,568 KB
testcase_22 AC 45 ms
20,848 KB
testcase_23 AC 48 ms
22,680 KB
testcase_24 AC 49 ms
22,720 KB
testcase_25 AC 47 ms
20,676 KB
testcase_26 AC 45 ms
20,820 KB
testcase_27 AC 48 ms
22,744 KB
testcase_28 AC 46 ms
22,804 KB
testcase_29 AC 46 ms
20,856 KB
testcase_30 AC 46 ms
20,712 KB
testcase_31 AC 45 ms
20,704 KB
testcase_32 AC 45 ms
22,732 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>();
        bool isRandomWalk = false;

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

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

0