結果

問題 No.290 1010
ユーザー bluemegane
提出日時 2021-04-22 07:42:21
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 33 ms / 5,000 ms
コード長 500 bytes
コンパイル時間 708 ms
コンパイル使用メモリ 108,424 KB
実行使用メモリ 28,484 KB
最終ジャッジ日時 2024-07-04 06:15:55
合計ジャッジ時間 2,108 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
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
{
    static void Main()
    {
        Console.ReadLine();
        var s = Console.ReadLine().Trim();
        getAns(s);
    }
    static bool calc(string s, string t) => s.IndexOf(t) != -1;
    static void getAns(string s)
    {
        if (s.Length >= 4) { Console.WriteLine("YES"); return; }
        if (calc(s, "00")) { Console.WriteLine("YES"); return; }
        if (calc(s, "11")) { Console.WriteLine("YES"); return; }
        Console.WriteLine("NO");
    }
}
0