結果
問題 | No.1137 Circles |
ユーザー | fastmath |
提出日時 | 2020-08-03 06:05:20 |
言語 | C++17(clang) (17.0.6 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 29 ms / 2,000 ms |
コード長 | 899 bytes |
コンパイル時間 | 1,707 ms |
コンパイル使用メモリ | 134,696 KB |
実行使用メモリ | 9,404 KB |
最終ジャッジ日時 | 2023-09-29 13:19:23 |
合計ジャッジ時間 | 3,050 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 6 ms
8,104 KB |
testcase_01 | AC | 29 ms
9,212 KB |
testcase_02 | AC | 4 ms
8,128 KB |
testcase_03 | AC | 15 ms
8,364 KB |
testcase_04 | AC | 21 ms
8,700 KB |
testcase_05 | AC | 8 ms
8,236 KB |
testcase_06 | AC | 24 ms
8,808 KB |
testcase_07 | AC | 14 ms
8,316 KB |
testcase_08 | AC | 24 ms
8,944 KB |
testcase_09 | AC | 9 ms
8,144 KB |
testcase_10 | AC | 14 ms
8,296 KB |
testcase_11 | AC | 16 ms
8,544 KB |
testcase_12 | AC | 29 ms
9,404 KB |
testcase_13 | AC | 9 ms
8,128 KB |
testcase_14 | AC | 29 ms
9,176 KB |
testcase_15 | AC | 12 ms
8,216 KB |
testcase_16 | AC | 18 ms
8,444 KB |
testcase_17 | AC | 5 ms
8,192 KB |
testcase_18 | AC | 24 ms
8,920 KB |
testcase_19 | AC | 10 ms
8,112 KB |
testcase_20 | AC | 8 ms
8,120 KB |
testcase_21 | AC | 6 ms
8,092 KB |
ソースコード
#include<bits/stdc++.h> using namespace std; #define int long long #define ii pair <int, int> #define app push_back #define all(a) a.begin(), a.end() #define bp __builtin_popcountll #define ll long long #define mp make_pair #define f first #define s second #define Time (double)clock()/CLOCKS_PER_SEC #define debug(x) std::cout << #x << ": " << x << '\n'; const int N = 6e5+7, ADD = 2e5+7; int a[N]; signed main() { #ifdef HOME freopen("input.txt", "r", stdin); #else #define endl '\n' ios_base::sync_with_stdio(0); cin.tie(0); #endif int n; cin >> n; vector <int> x(n), r(n); for (int i = 0; i < n; ++i) { cin >> x[i] >> r[i]; x[i] += ADD; a[x[i]-r[i]]++; a[x[i]+r[i]]--; } int ans = 0; for (int i = 1; i < N; ++i) { a[i] += a[i-1]; ans = max(ans, a[i]); } cout << ans << endl; }