Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
#include
#include
using namespace std; const int maxn = 1e5 + 10; int n, m; int maski[maxn], zenski[maxn]; int main() { cin >> n; vector
cnt(200, 0); for(int i = 0; i < n; i++) { cin >> maski[i]; cnt[maski[i]]++; } cin >> m; for(int i = 0; i < m; i++) { cin >> zenski[i]; } int R, k; cin >> R >> k; sort(maski, maski + n); sort(zenski, zenski + m); int res = 0; for(int i = 0, j = k - 1; j < m; i++, j++) { int A = zenski[j] - R; int B = zenski[i] + R; int c = 0; for(int j = A; j <= B; j++) { c += cnt[j]; } res = max(res, c); } cout << res << endl; return 0; }
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)