Submission #147506

#TimeUsernameProblemLanguageResultExecution timeMemory
147506ipaljakJarvis (COCI19_jarvis)C++14
70 / 70
51 ms3064 KiB
#include <bits/stdc++.h> using namespace std; #define TRACE(x) cerr << #x << " " << x << endl #define FOR(i, a, b) for (int i = (a); i < int(b); ++i) #define REP(i, n) FOR(i, 0, n) #define _ << " " << typedef long long llint; const int MOD = 1e9 + 7; const int MAXN = 1e5 + 10; int n; int a[MAXN], b[MAXN]; map<int, int> cnt; int main(void) { scanf("%d", &n); for (int i = 0; i < n; ++i) scanf("%d", &a[i]); for (int i = 0; i < n; ++i) scanf("%d", &b[i]); for (int i = 0; i < n; ++i) cnt[a[i] - b[i]]++; int sol = 0; for (const auto &kv : cnt) sol = max(sol, kv.second); printf("%d\n", sol); return 0; }

Compilation message (stderr)

jarvis.cpp: In function 'int main()':
jarvis.cpp:21:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &n);
   ~~~~~^~~~~~~~~~
jarvis.cpp:22:36: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   for (int i = 0; i < n; ++i) scanf("%d", &a[i]);
                               ~~~~~^~~~~~~~~~~~~
jarvis.cpp:23:36: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   for (int i = 0; i < n; ++i) scanf("%d", &b[i]);
                               ~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...