結果
問題 | No.491 10^9+1と回文 |
ユーザー |
|
提出日時 | 2017-12-12 16:28:39 |
言語 | D (dmd 2.109.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 384 bytes |
コンパイル時間 | 623 ms |
コンパイル使用メモリ | 106,788 KB |
実行使用メモリ | 13,752 KB |
最終ジャッジ日時 | 2024-06-12 23:02:14 |
合計ジャッジ時間 | 3,249 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | TLE * 1 -- * 102 |
ソースコード
import std.algorithm, std.conv, std.range, std.stdio, std.string; void main() { auto n = readln.chomp.to!long, k = (n/(10^^9+1)).to!int; auto s = k.to!string, ns = s.length, sh = 10^^ns, r = 0; foreach (i; 1..sh) { auto t = i.to!string, nt = t.length; if (chain(t, t.retro).to!long <= k) ++r; if (chain(t, t[0..$-1].retro).to!long <= k) ++r; } writeln(r); }