結果
| 問題 |
No.781 円周上の格子点の数え上げ
|
| コンテスト | |
| ユーザー |
ngtkana
|
| 提出日時 | 2020-03-14 13:00:33 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 110 ms / 2,000 ms |
| コード長 | 435 bytes |
| コンパイル時間 | 2,319 ms |
| コンパイル使用メモリ | 194,260 KB |
| 最終ジャッジ日時 | 2025-01-09 06:47:26 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 |
ソースコード
#include<bits/stdc++.h>
#define endl enjoy_codeforces
using lint=long long;
int main(){
std::cin.tie(nullptr);std::ios_base::sync_with_stdio(false);
lint X,Y;std::cin>>X>>Y;
std::vector<int>a(Y+1);
for(lint i=0;i*i<=Y;i++){
for(lint j=0;i*i+j*j<=Y;j++){
a.at(i*i+j*j)+=4;
}
}
for(lint i=1;i*i<=Y;i++)a.at(i*i)-=4;
std::cout<<*std::max_element(a.begin()+X,a.begin()+Y+1)<<'\n';
}
ngtkana