結果
問題 |
No.781 円周上の格子点の数え上げ
|
ユーザー |
|
提出日時 | 2019-01-12 02:51:42 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 406 bytes |
コンパイル時間 | 1,636 ms |
コンパイル使用メモリ | 167,832 KB |
実行使用メモリ | 51,476 KB |
最終ジャッジ日時 | 2024-12-14 13:59:55 |
合計ジャッジ時間 | 4,654 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 RE * 4 |
ソースコード
#include <bits/stdc++.h> using namespace std; int p[12345678]; int main() { ios::sync_with_stdio(false); cin.tie(0); int x, y; cin >> x >> y; int a = 1; while((a + 1) * (a + 1) <= y) { a++; } for(int i = 1; i <= a; i++) { for(int j = 0; j <= a; j++) { p[i * i + j * j]++; } } int ans = 0; for(int i = x; i <= y; i++) { ans = max(ans, p[i]); } cout << ans * 4 << endl; return 0; }