結果
問題 | No.781 円周上の格子点の数え上げ |
ユーザー | chocorusk |
提出日時 | 2019-01-11 21:29:03 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 295 ms / 2,000 ms |
コード長 | 674 bytes |
コンパイル時間 | 713 ms |
コンパイル使用メモリ | 92,088 KB |
実行使用メモリ | 42,604 KB |
最終ジャッジ日時 | 2023-08-20 03:38:32 |
合計ジャッジ時間 | 8,582 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 259 ms
42,468 KB |
testcase_01 | AC | 272 ms
42,428 KB |
testcase_02 | AC | 286 ms
42,388 KB |
testcase_03 | AC | 281 ms
42,360 KB |
testcase_04 | AC | 275 ms
42,604 KB |
testcase_05 | AC | 278 ms
42,396 KB |
testcase_06 | AC | 280 ms
42,376 KB |
testcase_07 | AC | 257 ms
42,416 KB |
testcase_08 | AC | 274 ms
42,476 KB |
testcase_09 | AC | 284 ms
42,468 KB |
testcase_10 | AC | 276 ms
42,392 KB |
testcase_11 | AC | 278 ms
42,392 KB |
testcase_12 | AC | 292 ms
42,388 KB |
testcase_13 | AC | 285 ms
42,428 KB |
testcase_14 | AC | 266 ms
42,380 KB |
testcase_15 | AC | 285 ms
42,392 KB |
testcase_16 | AC | 281 ms
42,464 KB |
testcase_17 | AC | 295 ms
42,424 KB |
testcase_18 | AC | 279 ms
42,440 KB |
testcase_19 | AC | 284 ms
42,400 KB |
testcase_20 | AC | 279 ms
42,592 KB |
ソースコード
#include <cstdio> #include <cstring> #include <iostream> #include <string> #include <cmath> #include <bitset> #include <vector> #include <map> #include <set> #include <queue> #include <deque> #include <algorithm> #include <complex> #include <unordered_map> #include <unordered_set> #include <random> #include <cassert> using namespace std; typedef long long int ll; typedef pair<int, int> P; int main() { int ct[10000001]={}; for(int i=-4000; i<=4000; i++){ for(int j=-4000; j<=4000; j++){ if(i*i+j*j<=10000000){ ct[i*i+j*j]++; } } } int x, y; cin>>x>>y; int ans=ct[x]; for(int i=x+1; i<=y; i++){ ans=max(ans, ct[i]); } cout<<ans<<endl; return 0; }