結果
問題 | No.781 円周上の格子点の数え上げ |
ユーザー |
![]() |
提出日時 | 2019-01-11 22:18:38 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 120 ms / 2,000 ms |
コード長 | 408 bytes |
コンパイル時間 | 1,238 ms |
コンパイル使用メモリ | 157,036 KB |
実行使用メモリ | 52,608 KB |
最終ジャッジ日時 | 2024-11-30 08:26:57 |
合計ジャッジ時間 | 4,391 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 21 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:9:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d%d",&lw,&hg); | ~~~~~^~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>using namespace std;#define REP(i,n) for(int i=0;i<(int)(n);i++)int lw, hg;int cnt[12525252];int main(){scanf("%d%d",&lw,&hg);int ans = -1;for(int x=0;x<=4000;x++)for(int y=1;y<=4000;y++){int v = x*x + y*y;if(v<12525252)cnt[v]++;}for(int r=lw;r<=hg;r++){ans = max(ans, cnt[r]);}printf("%d\n",ans*4);return 0;}