結果

問題 No.558 575検出するやつ
ユーザー pirorirori_n712pirorirori_n712
提出日時 2018-05-30 01:45:56
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 50 ms / 2,000 ms
コード長 603 bytes
コンパイル時間 2,212 ms
コンパイル使用メモリ 104,296 KB
実行使用メモリ 22,572 KB
最終ジャッジ日時 2023-09-12 20:33:23
合計ジャッジ時間 4,190 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
22,468 KB
testcase_01 AC 49 ms
20,480 KB
testcase_02 AC 48 ms
20,352 KB
testcase_03 AC 47 ms
20,412 KB
testcase_04 AC 48 ms
22,512 KB
testcase_05 AC 48 ms
20,480 KB
testcase_06 AC 50 ms
20,528 KB
testcase_07 AC 49 ms
22,572 KB
testcase_08 AC 47 ms
20,516 KB
testcase_09 AC 48 ms
22,500 KB
testcase_10 AC 48 ms
20,568 KB
testcase_11 AC 49 ms
22,492 KB
testcase_12 AC 48 ms
20,428 KB
testcase_13 AC 48 ms
20,480 KB
testcase_14 AC 48 ms
20,480 KB
testcase_15 AC 47 ms
20,508 KB
testcase_16 AC 48 ms
20,420 KB
testcase_17 AC 48 ms
20,588 KB
testcase_18 AC 48 ms
22,500 KB
testcase_19 AC 48 ms
20,424 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Linq;

class No558{
    static void Main(string[] args){
        var s=Console.ReadLine();
        var c=s.ToCharArray();
        var num=0;
        foreach(char l in c){
            switch(l){
                case '5':
                num=(num==0||num==12)?num+5:0;
                break;
                case '7':
                num=(num==5)?num+7:0;
                break;
                default:
                num=0;
                break;
            }
            if(num==17) break;
        }
        var a=(num!=17)?"NO":"YES";
        Console.WriteLine(a);
    }
}
0