結果

問題 No.627 ランダムウォークの軌跡
ユーザー iwkjosec
提出日時 2018-07-07 18:42:07
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 471 bytes
コンパイル時間 788 ms
コンパイル使用メモリ 111,940 KB
実行使用メモリ 25,808 KB
最終ジャッジ日時 2024-07-05 04:41:15
合計ジャッジ時間 2,633 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 static System.Console;

class Program
{
    static void Main()
    {
        var T = int.Parse(ReadLine());
        var p = 0;
        for (int i = 0; i < T; i++)
        {
            var x = int.Parse(ReadLine());
            if (Math.Abs(x - p) != 1)
            {
                WriteLine("F");
                return;
            }
            p = x;
        }
        WriteLine("T");
    }
}
0