結果

問題 No.653 E869120 and Lucky Numbers
ユーザー バカらっくバカらっく
提出日時 2018-02-27 22:43:02
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 4,994 bytes
コンパイル時間 2,928 ms
コンパイル使用メモリ 108,160 KB
実行使用メモリ 19,296 KB
最終ジャッジ日時 2024-05-07 17:18:49
合計ジャッジ時間 4,675 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
18,944 KB
testcase_01 AC 25 ms
18,816 KB
testcase_02 AC 26 ms
19,072 KB
testcase_03 AC 26 ms
18,944 KB
testcase_04 AC 25 ms
18,944 KB
testcase_05 AC 24 ms
18,816 KB
testcase_06 AC 26 ms
18,816 KB
testcase_07 WA -
testcase_08 AC 25 ms
18,900 KB
testcase_09 AC 25 ms
18,944 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 25 ms
18,688 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 25 ms
18,688 KB
testcase_18 AC 25 ms
18,688 KB
testcase_19 AC 25 ms
18,944 KB
testcase_20 AC 25 ms
18,816 KB
testcase_21 WA -
testcase_22 AC 24 ms
18,944 KB
testcase_23 WA -
testcase_24 AC 25 ms
18,816 KB
testcase_25 WA -
testcase_26 AC 25 ms
18,944 KB
testcase_27 AC 24 ms
18,816 KB
testcase_28 AC 28 ms
19,164 KB
testcase_29 AC 27 ms
19,296 KB
testcase_30 WA -
testcase_31 AC 24 ms
18,816 KB
testcase_32 WA -
testcase_33 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.IO;
using System.Linq;
using System.Collections.Generic;
using System.Text;

public class Program
{

    public void Proc()
    {
        int[] inpt = Reader.ReadLine().Reverse().Select(a=>int.Parse(a.ToString())).ToArray();

        string ans = "No";

        if(IsValid(inpt)) {
            ans = "Yes";
        }
        Console.WriteLine(ans);

    }

    private bool IsValid(int[] inpt) {
        for (int i = 0; i < inpt.Length; i++)
        {
            int num = inpt[i];

            if(i==0) {
                if(num >=2&&num>=4) {
                    continue;
                } else {
                    return false;
                }
            } else if(i == inpt.Length - 1) {
                if(num==1) {
                    return true;
                } else {
                    return false;
                }
            } else {
                if(num >= 3&&num<=5) {
                    continue;
                } else if(num == 7 || num == 8) {
                    for (int j = i + 1; j < inpt.Length; j++) {
                        if(inpt[j] != 6 && inpt[j] != 7) {
                            return false;
                        }
                    }
                    return true;
                }
            }

        }
        return true;
    }


    public class Reader
    {
        static StringReader sr;
        public static bool IsDebug = false;
        public static string ReadLine()
        {
            if (IsDebug)
            {
                if (sr == null)
                {
                    sr = new StringReader(InputText.Trim());
                }
                return sr.ReadLine();
            }
            else
            {
                return Console.ReadLine();
            }
        }
        private static string InputText = @"



705911737388353116828094829003413704629848147168047231489065274555933653942366096911323010774858296427342698920410286577728729557460839940538292739697050439544382252166872338933802404281706677280549061989461946673972768806628894288342003639214736129235569394922691973731136327130284384467284019748893960783101294913838476782983515562520429968832982319478460321360248255802904684923590893984528257497760973143333280874931796396855943260254079589491340130847790154376182849959172915187060421666913788124937616351122761325045424659946555371334347657441496108933159833421760273570798848469191034932947959370908838624829366880235282717924258951684133606033616031903302526852483735538689074308322968417766137054608678256672870631936874436815894900020588414526296716750357655749767859209597429343411364558534553163118938109462998611218261767748601048959463112383674026288927336017647470686849399230609501652661893493545672433267279166614907213719714236160948904457114550678750877008909523331916526198537851144882033586720224382826099769795898848521481583657620701705315711367058907749958010699260726184485822266594574856625623964800530850144165231145219223468405841812121941710768268269959255693592068214682173866308365847426201639016902822540005789439965216167372723357482654653404900483553773746461841144784076324376929920671480553248806502579268969021623414358456842118923923520596593091529736467672035320680864797401794372279887791220741099685283783893152695869343789376743682123695658509612216521802377054409868389336850391270100655769535597600661533274416837273895246505094878507522359697161017963141235485780055120516357809643799196957806045171657239336871895733042416759817889592360225648728619917280443664930727412293880313704635308162773893149866456817473213025837352214114648034166388052223676003114566227186760002981091101109416235088575878116345218590381999803527056119548542250936888251809076308255108628316175106419937671712632251327536957108233094270493070817165367072054957755574423650576924235668958813369568425316353682032108850119886564706307823637654113335827396989669318253325404996311503811424014470793272414268025892256107469501921888137110582141788760829632773564409799959590710896158277615173835280325135088365230971103189921652873288396869641474030460687091983183930885339660856954828075304668336759343317102234196046695938963331657274193359001833838755259877240405153522458748421577781879886446854514254616949413226084634966172798323086859286017482488449606278066052815431713827792048085791000589841203648465917037684019840418485519806743295842902384890544149817210131730942901137230384207979019310130524201714786114516711954772739317086886919646605953911821158517701891974821525347061911545444677868675259463583667338316548724165780770839689580528642103930810915266766580527270851359721378373495083202485366195099509160037363072349797206805295021615434808345299736019278324552454647287068424802058520256990154735312414806336920891745690260534260467844




";
    }

    public static void Main(string[] args)
    {
#if DEBUG
        Reader.IsDebug = true;
#endif
        Program prg = new Program();
        prg.Proc();
    }
}
0