結果

問題 No.1717 Levi-Civita Triangle
ユーザー bluemeganebluemegane
提出日時 2021-11-04 14:46:16
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 766 bytes
コンパイル時間 3,559 ms
コンパイル使用メモリ 104,576 KB
実行使用メモリ 32,000 KB
最終ジャッジ日時 2024-04-22 13:28:14
合計ジャッジ時間 5,088 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
17,664 KB
testcase_01 WA -
testcase_02 AC 24 ms
17,920 KB
testcase_03 AC 24 ms
17,792 KB
testcase_04 AC 24 ms
17,536 KB
testcase_05 AC 28 ms
18,176 KB
testcase_06 WA -
testcase_07 AC 55 ms
23,552 KB
testcase_08 AC 24 ms
17,664 KB
testcase_09 AC 23 ms
17,664 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 23 ms
17,792 KB
testcase_14 AC 24 ms
17,792 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 63 ms
25,600 KB
testcase_18 AC 25 ms
17,792 KB
testcase_19 WA -
testcase_20 AC 29 ms
18,432 KB
testcase_21 AC 31 ms
19,200 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 30 ms
18,176 KB
testcase_26 WA -
testcase_27 AC 38 ms
20,992 KB
testcase_28 AC 23 ms
17,792 KB
testcase_29 AC 23 ms
17,920 KB
testcase_30 AC 28 ms
18,304 KB
testcase_31 AC 30 ms
18,688 KB
testcase_32 AC 65 ms
26,368 KB
testcase_33 AC 81 ms
31,744 KB
testcase_34 AC 81 ms
31,744 KB
testcase_35 AC 80 ms
31,872 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 82 ms
31,872 KB
testcase_39 AC 81 ms
31,744 KB
testcase_40 AC 81 ms
31,744 KB
testcase_41 AC 81 ms
32,000 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 81 ms
31,872 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

public class hello
{
    public static int[] a;
    public static int n;
    static void Main()
    {
        n = int.Parse(Console.ReadLine().Trim());
        string[] line = Console.ReadLine().Trim().Split(' ');
         a = Array.ConvertAll(line, int.Parse);
        getAns();
    }
    static int  getNext ( int p , int pre )
    {
        var t = pre * 100 + a[p] * 10 + a[p + 1];
        if (t == 12 | t == 120 | t == 201) return 1;
        else if (t == 21 | t == 102 | t == 210) return 2;
        return 0;
    }
    static void getAns ()
    {
        var pre = getNext(1, a[0]);
        for (int i = 1; i < n; i++)
        {
            var w = getNext(2 * i + 1, pre);
            pre = w;
        }
        Console.WriteLine(pre);
    }
}
0