結果
問題 |
No.781 円周上の格子点の数え上げ
|
ユーザー |
![]() |
提出日時 | 2019-01-16 01:56:20 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 434 bytes |
コンパイル時間 | 718 ms |
コンパイル使用メモリ | 74,500 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-06-26 11:14:37 |
合計ジャッジ時間 | 4,445 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 TLE * 1 -- * 8 |
ソースコード
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <cmath> using namespace std; int main(){ int x,y; cin >> x >> y; int ans = 0; for(int i=x;i<=y;i++){ int c = 0; for(int j=0; i - j*j > 0; j++){ int n = i - j*j; int m = sqrt(n); if ( m*m == n ) c++; } ans = max(ans, 4*c); } cout << ans << endl; return 0; }