Submission #349407

# Submission time Handle Problem Language Result Execution time Memory
349407 2021-01-17T14:38:46 Z Nursik Cipele (COCI18_cipele) C++14
0 / 90
97 ms 3016 KB
#include <bits/stdc++.h>

#define fi first
#define se second
#define ll long long
#define pb push_back
#define all(v) v.begin(),v.end()
#define ld long double

using namespace std;

int block = 400;
const ld eps = 1e-7;

const int N = 3e5 + 500;
const int mod = 1e9 + 9;
const int mod2 = 998244353;

const ll hh = 29;
const ll hh2 = 31;

int n, m;
int a[N], b[N];
main()
{
    cin >> n >> m;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
    }
    for (int i = 1; i <= m; i++)
    {
        cin >> b[i];
    }
    sort(a + 1, a + n + 1), sort(b + 1, b + m + 1);
    if (n == m)
    {
        ll ans = 0;
        for (int i = 1; i <= n; i++)
        {
            ans += abs(a[i] - b[i]);
        }
        cout << ans << '\n';
    }
}
/*

*/

Compilation message

cipele.cpp:24:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   24 | main()
      |      ^
# Verdict Execution time Memory Grader output
1 Incorrect 75 ms 2796 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 97 ms 3016 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 492 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 75 ms 2540 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 84 ms 2592 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 76 ms 2540 KB Output isn't correct
2 Halted 0 ms 0 KB -