結果
問題 | No.781 円周上の格子点の数え上げ |
ユーザー |
|
提出日時 | 2019-01-12 11:04:22 |
言語 | D (dmd 2.109.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 557 bytes |
コンパイル時間 | 832 ms |
コンパイル使用メモリ | 118,820 KB |
実行使用メモリ | 226,132 KB |
最終ジャッジ日時 | 2024-06-13 02:42:31 |
合計ジャッジ時間 | 7,596 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 RE * 3 |
ソースコード
import std.stdio, std.array, std.string, std.conv, std.algorithm;import std.typecons, std.range, std.random, std.math, std.container;import std.numeric, std.bigint, core.bitop, core.stdc.string;void main() {auto s = readln.split.map!(to!long);auto X = s[0];auto Y = s[1];long[long] D;for (long i = 0; i * i <= Y; ++i) {for (long j = i; i * i + j * j <= Y; ++j) {D[i * i + j * j] += i == j || i == 0 ? 4 : 8;}}D.keys.filter!(k => X <= k && k <= Y).map!(k => D[k]).reduce!max.writeln;}