結果
問題 |
No.781 円周上の格子点の数え上げ
|
ユーザー |
|
提出日時 | 2019-01-11 21:54:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 508 bytes |
コンパイル時間 | 1,666 ms |
コンパイル使用メモリ | 167,200 KB |
実行使用メモリ | 13,640 KB |
最終ジャッジ日時 | 2024-11-30 06:02:20 |
合計ジャッジ時間 | 11,715 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 WA * 5 TLE * 3 |
ソースコード
#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++) { if(i % 4 != 1) continue; long long a = 0; for(int j = 1; j * j <= i; j++) { if(i % j == 0) { int k = i / j; if(j & 1) { a += pow(-1, (j - 1) / 2); } if(k & 1) { if(j == k) continue; a += pow(-1, (k - 1) / 2); } } } ans = max(ans, a * 4); } cout << ans << endl; return 0; }