Submission #528095

#TimeUsernameProblemLanguageResultExecution timeMemory
528095aris12345678Jarvis (COCI19_jarvis)C++14
70 / 70
39 ms1132 KiB
#include <bits/stdc++.h> using namespace std; #define X first #define Y second int main() { int n; scanf("%d", &n); vector<int> a(n); for(int i = 0; i < n; i++) scanf("%d", &a[i]); map<int, int> mp; int ans = 0; for(int i = 0; i < n; i++) { int b; scanf("%d", &b); mp[b-a[i]]++; ans = max(ans, mp[b-a[i]]); } printf("%d\n", ans); return 0; }

Compilation message (stderr)

jarvis.cpp: In function 'int main()':
jarvis.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~
jarvis.cpp:12:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |         scanf("%d", &a[i]);
      |         ~~~~~^~~~~~~~~~~~~
jarvis.cpp:17:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |         scanf("%d", &b);
      |         ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...