結果
| 問題 | No.781 円周上の格子点の数え上げ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-11 21:59:27 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 468 bytes |
| 記録 | |
| コンパイル時間 | 944 ms |
| コンパイル使用メモリ | 184,520 KB |
| 実行使用メモリ | 7,976 KB |
| 最終ジャッジ日時 | 2026-05-23 22:54:50 |
| 合計ジャッジ時間 | 4,936 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 WA * 1 TLE * 1 -- * 8 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int x, y;
cin >> x >> y;
long long ans = 0;
for(int i = x; i <= y; i++) {
long long a = 0;
for(int j = 1; j * j <= i; j++) {
if(i % j == 0) {
if(j % 4 == 1) a++;
if(j % 3 == 0) a--;
int k = i / j;
if(j == k) continue;
if(k % 4 == 1) a++;
if(k % 3 == 0) a--;
}
}
ans = max(ans, a * 4);
}
cout << ans << endl;
return 0;
}