Submission #818817

# Submission time Handle Problem Language Result Execution time Memory
818817 2023-08-10T06:50:22 Z vjudge1 Cipele (COCI18_cipele) C++17
18 / 90
34 ms 1108 KB
#include <cstdio>
#include <algorithm>
const int mxn = 100000;
int n, m, i, a[mxn], b[mxn], ug;
int main() {
    scanf("%d%d", &n, &m);
    if (n != m) return 0;
    for (i = 0; i < n; i++) scanf("%d", a + i);
    for (i = 0; i < m; i++) scanf("%d", b + i);
    std::sort(a, a + n);
    std::sort(b, b + m);
    for (i = 0; i < n; i++) {
        if (ug < abs(a[i] - b[i])) ug = abs(a[i] - b[i]);
    }
    printf("%d", ug);
    return 0;
}

Compilation message

cipele.cpp: In function 'int main()':
cipele.cpp:6:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    6 |     scanf("%d%d", &n, &m);
      |     ~~~~~^~~~~~~~~~~~~~~~
cipele.cpp:8:34: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |     for (i = 0; i < n; i++) scanf("%d", a + i);
      |                             ~~~~~^~~~~~~~~~~~~
cipele.cpp:9:34: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     for (i = 0; i < m; i++) scanf("%d", b + i);
      |                             ~~~~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 19 ms 980 KB Output is correct
2 Correct 29 ms 1064 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 34 ms 1108 KB Output is correct
2 Correct 30 ms 980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -