結果

問題 No.653 E869120 and Lucky Numbers
ユーザー WagiHOH
提出日時 2018-03-23 20:44:56
言語 D
(dmd 2.109.1)
結果
RE  
実行時間 -
コード長 434 bytes
コンパイル時間 813 ms
コンパイル使用メモリ 92,676 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-13 00:07:09
合計ジャッジ時間 1,576 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 RE * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.conv;
import std.stdio;
import std.string;


void main(string[] args)
{
    bool calc (int a, int b, int p)
    {
        immutable total = a + b;
        return
            total <= p && (
                total == p ||
                calc(a * 10 + 6, b, p) || calc(a * 10 + 7, b, p) ||
                calc(a, b * 10 + 6, p) || calc(a, b * 10 + 7, p));
    }
    ["No", "Yes"][calc(0, 0, readln.chomp.to!int)].writeln;
}
0