結果

問題 No.207 世界のなんとか
コンテスト
ユーザー nak2yoshi
提出日時 2016-02-23 22:21:31
言語 D
(dmd 2.112.0)
コンパイル:
dmd -fPIE -m64 -w -wi -O -release -inline -I/opt/dmd/src/druntime/import/ -I/opt/dmd/src/phobos -L-L/opt/dmd/linux/lib64/ -fPIC _filename_
実行:
./Main
結果
CE  
(最新)
AC  
(最初)
実行時間 -
コード長 312 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 961 ms
コンパイル使用メモリ 83,968 KB
最終ジャッジ日時 2026-05-10 04:21:18
合計ジャッジ時間 1,712 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。

コンパイルメッセージ
Main.d(14): Error: no property `countchars` for `to(a)` of type `string`
    A.iota(B + 1).filter!(a => a%3==0||a.to!string.countchars("3")>0).each!writeln;
                                                  ^
/home/linuxbrew/.linuxbrew/opt/dmd/include/dlang/dmd/std/algorithm/iteration.d(1505):        instantiated from here: `FilterResult!(__lambda_L14_C27, Result)`
        return FilterResult!(unaryFun!predicate, Range)(range);
               ^
Main.d(14):        instantiated from here: `filter!(Result)`
    A.iota(B + 1).filter!(a => a%3==0||a.to!string.countchars("3")>0).each!writeln;
                 ^

ソースコード

diff #
raw source code

import std.stdio,
       std.conv,
       std.string,
       std.range,
       std.math,
       std.algorithm,
       std.bigint;

void main()
{
    auto input = readln.split.to!(uint[]);
    auto A = input[0], B = input[1];

    A.iota(B + 1).filter!(a => a%3==0||a.to!string.countchars("3")>0).each!writeln;
}
0