結果
| 問題 | No.781 円周上の格子点の数え上げ | 
| コンテスト | |
| ユーザー |  iicafiaxus | 
| 提出日時 | 2019-01-11 22:33:40 | 
| 言語 | D (dmd 2.109.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1,016 ms / 2,000 ms | 
| コード長 | 774 bytes | 
| コンパイル時間 | 1,104 ms | 
| コンパイル使用メモリ | 125,316 KB | 
| 実行使用メモリ | 113,120 KB | 
| 最終ジャッジ日時 | 2024-06-13 02:39:38 | 
| 合計ジャッジ時間 | 8,394 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 21 | 
ソースコード
import std.stdio, std.conv, std.string, std.bigint;
import std.math, std.random, std.datetime;
import std.array, std.range, std.algorithm, std.container, std.format;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }
void main(){
	int x = read.to!int;
	int y = read.to!int;
	
	int[] qs;
	for(int a = 0; a <= y; a ++){
		qs ~= a * a;
	}
	
	int[] count;
	for(int r = 0; r <= y; r ++){
		count ~= 0;
	}
	
	
	int bmax = y;
	for(int a = 0; qs[a] <= y; a ++){
		int r;
		for(int b = 1; qs[b] <= y; b ++){
			r = qs[a] + qs[b];
			if(r > y) break;
			count[r] += 1;
		}
	}
	
	int countmax = 0;
	for(int r = x; r <= y; r ++){
		if(count[r] > countmax) countmax = count[r];
	}
	
	(countmax * 4).writeln;
	
}
            
            
            
        