結果
問題 | No.781 円周上の格子点の数え上げ |
ユーザー |
|
提出日時 | 2019-01-27 15:33:16 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 158 ms / 2,000 ms |
コード長 | 267 bytes |
コンパイル時間 | 886 ms |
コンパイル使用メモリ | 67,408 KB |
実行使用メモリ | 42,624 KB |
最終ジャッジ日時 | 2024-09-24 17:42:27 |
合計ジャッジ時間 | 4,993 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 5 | main() | ^~~~
ソースコード
#include<iostream> #include<algorithm> using namespace std; int x,y,cnt[10000001]; main() { cin>>x>>y; for(int i=0;i*i<=1e7;i++) { for(int j=0;i*i+j*j<=1e7;j++)cnt[i*i+j*j]+=(i?2:1)*(j?2:1); } int ans=0; for(;x<=y;x++)ans=max(ans,cnt[x]); cout<<ans<<endl; }