結果

問題 No.627 ランダムウォークの軌跡
ユーザー No
提出日時 2018-01-05 22:19:45
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 588 bytes
コンパイル時間 894 ms
コンパイル使用メモリ 103,552 KB
実行使用メモリ 17,664 KB
最終ジャッジ日時 2024-12-23 06:45:38
合計ジャッジ時間 2,429 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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;

namespace y
{
    class Program
    {
        static void Main(string[] args)
        {
            int c = int.Parse(Console.ReadLine());
            int t = 0;
            bool f = true;

            for (int i = 0 ; i < c ; i++)
            {
                int n = int.Parse(Console.ReadLine());
                if (n != t + 1 && n != t - 1)
                {
                    f = false;
                    break;
                }
                t = n;
            }
     
            if (f) Console.WriteLine("T");
else Console.WriteLine("F");
        }
    }
}
0